-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af3c230
commit 309cac7
Showing
108 changed files
with
717 additions
and
695 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+136 KB
...intrc-npm-1.3.1-f9e7aea43c-9844dcc58a.zip → ...intrc-npm-1.3.3-9e3a462140-f03e9d6727.zip
Binary file not shown.
Binary file removed
BIN
-15.7 KB
.yarn/cache/@humanwhocodes-config-array-npm-0.10.4-8334b3c6a2-d480e5d57e.zip
Binary file not shown.
Binary file added
BIN
+16.6 KB
.yarn/cache/@humanwhocodes-config-array-npm-0.10.7-81c0f4b5e6-009d64be8d.zip
Binary file not shown.
Binary file removed
BIN
-8.68 KB
.yarn/cache/@humanwhocodes-gitignore-to-minimatch-npm-1.0.2-247ae8a408-aba5c40c9e.zip
Binary file not shown.
Binary file added
BIN
+306 KB
.yarn/cache/@typescript-eslint-scope-manager-npm-5.39.0-3bce0c88f0-8d8b55eb21.zip
Binary file not shown.
Binary file added
BIN
+41.8 KB
.yarn/cache/@typescript-eslint-types-npm-5.39.0-1c26ad3ade-5f67fe02ad.zip
Binary file not shown.
Binary file added
BIN
+153 KB
.yarn/cache/@typescript-eslint-typescript-estree-npm-5.39.0-d5659c74ce-86143dd9dd.zip
Binary file not shown.
Binary file added
BIN
+167 KB
.yarn/cache/@typescript-eslint-utils-npm-5.39.0-401dad3ea6-460a883775.zip
Binary file not shown.
Binary file added
BIN
+10.6 KB
.yarn/cache/@typescript-eslint-visitor-keys-npm-5.39.0-5dd5e2b702-941e49fd1f.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+60.9 KB
...vity-npm-3.2.38-6f7f3405e8-c9afb01846.zip → ...vity-npm-3.2.40-d9155c50c7-927d22b424.zip
Binary file not shown.
Binary file renamed
BIN
+8.97 KB
...form-npm-3.2.38-a150dadf5f-84b665185e.zip → ...form-npm-3.2.40-c8706743e9-b86fc29b52.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-122 KB
.yarn/cache/@vue-server-renderer-npm-3.2.38-9a4710effb-d7d8458e69.zip
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+31.6 KB
...ared-npm-3.2.38-96d5011787-c1aa5ec132.zip → ...ared-npm-3.2.40-6b1329b2bd-d91a1e12ff.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.84 KB
.yarn/cache/browser-process-hrtime-npm-1.0.0-db700805c2-e30f868cdb.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+735 KB
...lint-npm-8.23.0-4ce1a8504a-ff6075daa2.zip → ...lint-npm-8.25.0-2af5e4f121-7acf2693b5.zip
Binary file not shown.
Binary file removed
BIN
-76.3 KB
.yarn/cache/eslint-plugin-solid-npm-0.7.1-374d9fa5dd-6a68bd95d2.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+619 KB
...sdom-npm-20.0.0-9c1ad43ab8-f69b40679d.zip → ...sdom-npm-20.0.1-b1381838f2-9fc0b66a86.zip
Binary file not shown.
Binary file renamed
BIN
+76.7 KB
...utils-npm-3.3.2-fdadb9d53a-61d4596d44.zip → ...utils-npm-3.3.3-3d3171e1e4-a2ed78cac4.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+12.7 KB
...ypool-npm-0.2.4-1940a28d43-f050bd36c8.zip → ...ypool-npm-0.3.0-e11f8ec8eb-92291c309e.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-21.1 KB
.yarn/cache/vite-plugin-externalize-deps-npm-0.1.4-3e4cf2a6d5-ea7328d220.zip
Binary file not shown.
Binary file added
BIN
+21.3 KB
.yarn/cache/vite-plugin-externalize-deps-npm-0.4.0-1e15e407a0-d5e4d45d99.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file renamed
BIN
+38.3 KB
...he/ws-npm-8.8.1-955e8c9f58-2152cf862c.zip → ...he/ws-npm-8.9.0-d620434feb-23aa0f021b.zip
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type InkInternal from '/types/internal' | ||
|
||
export const destroy = ([state]: InkInternal.Store) => { | ||
const { editor } = state() | ||
|
||
editor.destroy() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type InkInternal from '/types/internal' | ||
|
||
export const focus = ([state]: InkInternal.Store) => { | ||
const { editor } = state() | ||
|
||
if (!editor.hasFocus) { | ||
editor.focus() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type InkInternal from '/types/internal' | ||
|
||
export const getDoc = ([state]: InkInternal.Store) => { | ||
const { editor } = state() | ||
|
||
return editor.state.sliceDoc() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export * from './destroy' | ||
export * from './focus' | ||
export * from './format' | ||
export * from './get_doc' | ||
export * from './insert' | ||
export * from './load' | ||
export * from './options' | ||
export * from './reconfigure' | ||
export * from './select' | ||
export * from './selections' | ||
export * from './update' | ||
export * from './wrap' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { selections } from './selections' | ||
import type * as Ink from '/types/ink' | ||
import type InkInternal from '/types/internal' | ||
|
||
export const insert = ([state, setState]: InkInternal.Store, text: string, selection?: Ink.Editor.Selection, updateSelection = false) => { | ||
const { editor } = state() | ||
|
||
let start = selection?.start | ||
let end = selection?.end || selection?.start | ||
|
||
if (typeof start === 'undefined') { | ||
const current = selections([state, setState]).pop() as Ink.Editor.Selection | ||
|
||
start = current.start | ||
end = current.end | ||
} | ||
|
||
const updates = { changes: { from: start, to: end, insert: text } } | ||
|
||
if (updateSelection) { | ||
const anchor = start === end ? start + text.length : start | ||
const head = start === end ? start + text.length : start + text.length | ||
|
||
Object.assign(updates, { selection: { anchor, head } }) | ||
} | ||
|
||
editor.dispatch( | ||
editor.state.update(updates), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { override } from '/src/utils/merge' | ||
import { makeState } from '/src/vendor/state' | ||
import type InkInternal from '/types/internal' | ||
|
||
export const load = ([state, setState]: InkInternal.Store, doc: string) => { | ||
setState(override(state(), { options: { doc } })) | ||
|
||
state().editor.setState(makeState(state())) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type InkInternal from '/types/internal' | ||
|
||
export const options = ([state]: InkInternal.Store) => { | ||
return state().options | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { buildVendorUpdates } from '/src/extensions' | ||
import { override } from '/src/utils/merge' | ||
import type * as Ink from '/types/ink' | ||
import type InkInternal from '/types/internal' | ||
|
||
export const reconfigure = ([state, setState]: InkInternal.Store, options: Ink.Options) => { | ||
const effects = buildVendorUpdates(setState(override(state(), { options }))) | ||
|
||
state().editor.dispatch({ | ||
effects, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { toCodeMirror } from '/src/vendor/adapters/selections' | ||
import * as InkValues from '/types/values' | ||
import type * as Ink from '/types/ink' | ||
import type InkInternal from '/types/internal' | ||
|
||
export const select = (store: InkInternal.Store, options: Ink.Instance.SelectOptions = {}) => { | ||
if (options.selections) | ||
return selectMultiple(store, options.selections) | ||
if (options.selection) | ||
return selectOne(store, options.selection) | ||
if (options.at) | ||
return selectAt(store, options.at) | ||
} | ||
|
||
export const selectAt = (store: InkInternal.Store, at: Ink.Values.Selection) => { | ||
const [state] = store | ||
|
||
if (at === InkValues.Selection.Start) | ||
return selectOne(store, { start: 0, end: 0 }) | ||
|
||
if (at === InkValues.Selection.End) { | ||
const position = state().editor.state.doc.length | ||
|
||
return selectOne(store, { start: position, end: position }) | ||
} | ||
} | ||
|
||
export const selectMultiple = ([state]: InkInternal.Store, selections: Ink.Editor.Selection[]) => { | ||
const { editor } = state() | ||
|
||
editor.dispatch( | ||
editor.state.update({ | ||
selection: toCodeMirror(selections), | ||
}), | ||
) | ||
} | ||
|
||
export const selectOne = (store: InkInternal.Store, selection: Ink.Editor.Selection) => { | ||
return selectMultiple(store, [selection]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { toInk } from '/src/vendor/adapters/selections' | ||
import type * as Ink from '/types/ink' | ||
import type InkInternal from '/types/internal' | ||
|
||
export const selections = ([state]: InkInternal.Store): Ink.Editor.Selection[] => { | ||
const { editor } = state() | ||
|
||
return toInk(editor.state.selection) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type InkInternal from '/types/internal' | ||
|
||
export const update = ([state]: InkInternal.Store, doc: string) => { | ||
const { editor } = state() | ||
|
||
editor.dispatch( | ||
editor.state.update({ | ||
changes: { | ||
from: 0, | ||
to: editor.state.doc.length, | ||
insert: doc, | ||
}, | ||
}), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { insert } from './insert' | ||
import { select } from './select' | ||
import { selections } from './selections' | ||
import type * as Ink from '/types/ink' | ||
import type InkInternal from '/types/internal' | ||
|
||
export const wrap = ([state, setState]: InkInternal.Store, { after, before, selection: userSelection }: Ink.Instance.WrapOptions) => { | ||
const { editor } = state() | ||
|
||
const selection = userSelection || selections([state, setState]).pop() || { start: 0, end: 0 } | ||
const text = editor.state.sliceDoc(selection.start, selection.end) | ||
|
||
insert([state, setState], `${before}${text}${after}`, selection) | ||
select([state, setState], { selections: [{ start: selection.start + before.length, end: selection.end + before.length }] }) | ||
} |
Oops, something went wrong.