solid-ui 3.1.3-16 → 3.1.3-17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/src-BImdSpRx.js +32792 -0
- package/dist/chunks/src-BImdSpRx.js.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +4 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/lib/code-editor/CodeEditor.cjs.js +2 -0
- package/dist/lib/code-editor/CodeEditor.cjs.js.map +1 -0
- package/dist/lib/code-editor/CodeEditor.d.ts +18 -0
- package/dist/lib/code-editor/CodeEditor.d.ts.map +1 -0
- package/dist/lib/code-editor/CodeEditor.esm.js +107 -0
- package/dist/lib/code-editor/CodeEditor.esm.js.map +1 -0
- package/dist/lib/code-editor/index.cjs.js +1 -0
- package/dist/lib/code-editor/index.d.ts +2 -0
- package/dist/lib/code-editor/index.d.ts.map +1 -0
- package/dist/lib/code-editor/index.esm.js +2 -0
- package/dist/loader.js +5 -5
- package/dist/solid-ui.js +153 -115
- package/dist/solid-ui.min.js +153 -115
- package/dist/solid-ui.min.js.map +1 -1
- package/package.json +13 -1
- package/dist/chunks/src--J7RRo6J.js +0 -15583
- package/dist/chunks/src--J7RRo6J.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib/ns.cjs.js"),t=require("./lib/log.cjs.js"),n=require("./utils/index.cjs.js"),r=require("./lib/style.cjs.js"),i=require("./lib/iconBase.cjs.js"),a=require("./widgets/forms/autocomplete/language.cjs.js"),o=require("./widgets/index.cjs.js"),s=require("./login/login.cjs.js"),c=require("./acl/index.cjs.js"),l=require("./create/index.cjs.js"),u=require("./matrix/index.cjs.js"),d=require("./media/index.cjs.js"),f=require("./lib/messageArea.cjs.js"),p=require("./lib/participation.cjs.js"),m=require("./lib/pad.cjs.js"),h=require("./chat/infinite.cjs.js"),g=require("./lib/preferences.cjs.js"),_=require("./lib/table.cjs.js"),v=require("./lib/tabs.cjs.js"),y=require("./header/index.cjs.js"),b=require("./footer/index.cjs.js"),x=require("./create/types.cjs.js"),S=require("./lib/auth/Account.cjs.js"),C=require("./lib/auth/NoopAuth.cjs.js"),w=require("./lib/auth/context.cjs.js"),T=require("./lib/components/ids.cjs.js"),E=require("./lib/dialogs/context.cjs.js"),D=require("./lib/components/decorators.cjs.js"),O=require("./lib/dialogs/events/close-dialog.cjs.js"),k=require("./lib/components/traits/DialogTrait.cjs.js"),A=require("./lib/components/web-component/WebComponent.cjs.js"),j=require("./lib/components/dialog-component/DialogComponent.cjs.js"),M=require("./lib/components/traits/FormControlTrait.cjs.js"),N=require("./lib/components/form-control-component/FormControlComponent.cjs.js");require("./lib/components/index.cjs.js");const P=require("./lib/dialogs/Dialog.cjs.js"),F=require("./lib/dialogs/events/show-dialog.cjs.js"),I=require("./lib/dialogs/helpers.cjs.js");require("./lib/dialogs/index.cjs.js");const L=require("./lib/auth/SolidAuth.cjs.js");require("./lib/auth/index.cjs.js");const R=require("./lib/file-explorer/context.cjs.js");var
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib/ns.cjs.js"),t=require("./lib/log.cjs.js"),n=require("./utils/index.cjs.js"),r=require("./lib/style.cjs.js"),i=require("./lib/iconBase.cjs.js"),a=require("./widgets/forms/autocomplete/language.cjs.js"),o=require("./widgets/index.cjs.js"),s=require("./login/login.cjs.js"),c=require("./acl/index.cjs.js"),l=require("./create/index.cjs.js"),u=require("./matrix/index.cjs.js"),d=require("./media/index.cjs.js"),f=require("./lib/messageArea.cjs.js"),p=require("./lib/participation.cjs.js"),m=require("./lib/pad.cjs.js"),h=require("./chat/infinite.cjs.js"),g=require("./lib/preferences.cjs.js"),_=require("./lib/table.cjs.js"),v=require("./lib/tabs.cjs.js"),y=require("./header/index.cjs.js"),b=require("./footer/index.cjs.js"),x=require("./create/types.cjs.js"),S=require("./lib/auth/Account.cjs.js"),C=require("./lib/auth/NoopAuth.cjs.js"),w=require("./lib/auth/context.cjs.js"),T=require("./lib/components/ids.cjs.js"),E=require("./lib/dialogs/context.cjs.js"),D=require("./lib/components/decorators.cjs.js"),O=require("./lib/dialogs/events/close-dialog.cjs.js"),k=require("./lib/components/traits/DialogTrait.cjs.js"),A=require("./lib/components/web-component/WebComponent.cjs.js"),j=require("./lib/components/dialog-component/DialogComponent.cjs.js"),M=require("./lib/components/traits/FormControlTrait.cjs.js"),N=require("./lib/components/form-control-component/FormControlComponent.cjs.js");require("./lib/components/index.cjs.js");const P=require("./lib/dialogs/Dialog.cjs.js"),F=require("./lib/dialogs/events/show-dialog.cjs.js"),I=require("./lib/dialogs/helpers.cjs.js");require("./lib/dialogs/index.cjs.js");const L=require("./lib/auth/SolidAuth.cjs.js");require("./lib/auth/index.cjs.js");const R=require("./lib/file-explorer/context.cjs.js"),z=require("./lib/code-editor/CodeEditor.cjs.js");require("./lib/code-editor/index.cjs.js");var B=typeof window<`u`?window.document:null;exports.Account=S.default,exports.CloseDialogEvent=O.CloseDialogEvent,exports.CodeEditor=z.CodeEditor,exports.DEFAULT_AUTH_CONTEXT=w.DEFAULT_AUTH_CONTEXT,exports.DEFAULT_DIALOG_CONTEXT=E.DEFAULT_DIALOG_CONTEXT,exports.DEFAULT_SIGNUP_URL=L.DEFAULT_SIGNUP_URL,exports.Dialog=P.default,exports.DialogComponent=j.default,exports.DialogTrait=k.default,exports.FormControlComponent=N.default,exports.FormControlTrait=M.default,exports.NoopAuth=C.default,exports.ShowDialogEvent=F.ShowDialogEvent,exports.SolidAuth=L.default,exports.WebComponent=A.default,exports.acl=c.acl,exports.aclControl=c.aclControl,exports.authContext=w.authContext,exports.create=l.create,Object.defineProperty(exports,"createTypes",{enumerable:!0,get:function(){return x.types_exports}}),exports.customElement=D.customElement,exports.dialogContext=E.dialogContext,exports.dom=B,exports.fileExplorerContext=R.fileExplorerContext,exports.generateId=T.generateId,exports.icons=i.icons,exports.infiniteMessageArea=h.infiniteMessageArea,exports.initFooter=b.initFooter,exports.initHeader=y.initHeader,Object.defineProperty(exports,"language",{enumerable:!0,get:function(){return a.language_exports}}),Object.defineProperty(exports,"log",{enumerable:!0,get:function(){return t.log_exports}}),Object.defineProperty(exports,"login",{enumerable:!0,get:function(){return s.login_exports}}),exports.matrix=u.matrix,exports.media=d.media,exports.messageArea=f.messageArea,exports.ns=e.default,Object.defineProperty(exports,"pad",{enumerable:!0,get:function(){return m.pad_exports}}),Object.defineProperty(exports,"participation",{enumerable:!0,get:function(){return p.participation_exports}}),Object.defineProperty(exports,"preferences",{enumerable:!0,get:function(){return g.preferences_exports}}),exports.showDialog=I.showDialog,exports.style=r.style,exports.table=_.renderTableViewPane,Object.defineProperty(exports,"tabs",{enumerable:!0,get:function(){return v.tabs_exports}}),Object.defineProperty(exports,"utils",{enumerable:!0,get:function(){return n.utils_exports}}),Object.defineProperty(exports,"widgets",{enumerable:!0,get:function(){return o.widgets_exports}});
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// REMOVE @ts-ignore as you migrate files to TypeScript\n// @ts-ignore\nimport ns from './lib/ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './lib/iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './lib/log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './lib/messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './lib/pad'\n// @ts-ignore\nimport * as participation from './lib/participation'\n// @ts-ignore\nimport * as preferences from './lib/preferences'\n// @ts-ignore\nimport { style } from './lib/style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './lib/table'\nimport * as tabs from './lib/tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\n\nexport const dom = typeof window !== 'undefined' ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\n// this variables are directly used in the storybook\nexport {\n ns,\n acl,\n aclControl,\n create,\n createTypes,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n initHeader,\n initFooter\n}\n// uses in solid-panes\nexport type { CreateContext, NewAppInstanceOptions } from './create/types'\n\nexport * from './lib/auth'\nexport * from './lib/components'\nexport * from './lib/dialogs'\nexport * from './lib/file-explorer/context'\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// REMOVE @ts-ignore as you migrate files to TypeScript\n// @ts-ignore\nimport ns from './lib/ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './lib/iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './lib/log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './lib/messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './lib/pad'\n// @ts-ignore\nimport * as participation from './lib/participation'\n// @ts-ignore\nimport * as preferences from './lib/preferences'\n// @ts-ignore\nimport { style } from './lib/style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './lib/table'\nimport * as tabs from './lib/tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\n\nexport const dom = typeof window !== 'undefined' ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\n// this variables are directly used in the storybook\nexport {\n ns,\n acl,\n aclControl,\n create,\n createTypes,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n initHeader,\n initFooter\n}\n// uses in solid-panes\nexport type { CreateContext, NewAppInstanceOptions } from './create/types'\n\nexport * from './lib/auth'\nexport * from './lib/components'\nexport * from './lib/dialogs'\nexport * from './lib/file-explorer/context'\nexport * from './lib/code-editor'\n"],"mappings":"04DAkCA,IAAa,EAAM,OAAO,OAAW,IAAc,OAAO,SAAW"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,QAAQ,MAAM,uCAAuC,CAAA;AACjE,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAErD,OAAO,KAAK,GAAG,MAAM,WAAW,CAAA;AAEhC,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAA;AAEpD,OAAO,KAAK,WAAW,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AAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mBAAmB,CAAA"}
|
package/dist/index.esm.js
CHANGED
|
@@ -40,9 +40,11 @@ import "./lib/dialogs/index.esm.js";
|
|
|
40
40
|
import B, { DEFAULT_SIGNUP_URL as V } from "./lib/auth/SolidAuth.esm.js";
|
|
41
41
|
import "./lib/auth/index.esm.js";
|
|
42
42
|
import { fileExplorerContext as H } from "./lib/file-explorer/context.esm.js";
|
|
43
|
+
import { CodeEditor as U } from "./lib/code-editor/CodeEditor.esm.js";
|
|
44
|
+
import "./lib/code-editor/index.esm.js";
|
|
43
45
|
//#region src/index.ts
|
|
44
|
-
var
|
|
46
|
+
var W = typeof window < "u" ? window.document : null;
|
|
45
47
|
//#endregion
|
|
46
|
-
export { C as Account, j as CloseDialogEvent, T as DEFAULT_AUTH_CONTEXT, O as DEFAULT_DIALOG_CONTEXT, V as DEFAULT_SIGNUP_URL, L as Dialog, P as DialogComponent, M as DialogTrait, I as FormControlComponent, F as FormControlTrait, w as NoopAuth, R as ShowDialogEvent, B as SolidAuth, N as WebComponent, c as acl, l as aclControl, E as authContext, u as create, S as createTypes, A as customElement, k as dialogContext,
|
|
48
|
+
export { C as Account, j as CloseDialogEvent, U as CodeEditor, T as DEFAULT_AUTH_CONTEXT, O as DEFAULT_DIALOG_CONTEXT, V as DEFAULT_SIGNUP_URL, L as Dialog, P as DialogComponent, M as DialogTrait, I as FormControlComponent, F as FormControlTrait, w as NoopAuth, R as ShowDialogEvent, B as SolidAuth, N as WebComponent, c as acl, l as aclControl, E as authContext, u as create, S as createTypes, A as customElement, k as dialogContext, W as dom, H as fileExplorerContext, D as generateId, i as icons, g as infiniteMessageArea, x as initFooter, b as initHeader, a as language, t as log, s as login, d as matrix, f as media, p as messageArea, e as ns, h as pad, m as participation, _ as preferences, z as showDialog, r as style, v as table, y as tabs, n as utils, o as widgets };
|
|
47
49
|
|
|
48
50
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// REMOVE @ts-ignore as you migrate files to TypeScript\n// @ts-ignore\nimport ns from './lib/ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './lib/iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './lib/log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './lib/messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './lib/pad'\n// @ts-ignore\nimport * as participation from './lib/participation'\n// @ts-ignore\nimport * as preferences from './lib/preferences'\n// @ts-ignore\nimport { style } from './lib/style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './lib/table'\nimport * as tabs from './lib/tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\n\nexport const dom = typeof window !== 'undefined' ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\n// this variables are directly used in the storybook\nexport {\n ns,\n acl,\n aclControl,\n create,\n createTypes,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n initHeader,\n initFooter\n}\n// uses in solid-panes\nexport type { CreateContext, NewAppInstanceOptions } from './create/types'\n\nexport * from './lib/auth'\nexport * from './lib/components'\nexport * from './lib/dialogs'\nexport * from './lib/file-explorer/context'\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// REMOVE @ts-ignore as you migrate files to TypeScript\n// @ts-ignore\nimport ns from './lib/ns'\nimport { acl, aclControl } from './acl/index'\nimport { create } from './create/index'\n// @ts-ignore\nimport { icons } from './lib/iconBase'\nimport * as language from './widgets/forms/autocomplete/language'\nimport * as log from './lib/log'\nimport { matrix } from './matrix/index'\nimport { media } from './media/index'\n// @ts-ignore\nimport { messageArea } from './lib/messageArea'\n// @ts-ignore\nimport { infiniteMessageArea } from './chat/infinite'\n// @ts-ignore\nimport * as pad from './lib/pad'\n// @ts-ignore\nimport * as participation from './lib/participation'\n// @ts-ignore\nimport * as preferences from './lib/preferences'\n// @ts-ignore\nimport { style } from './lib/style'\n// @ts-ignore\nimport { renderTableViewPane as table } from './lib/table'\nimport * as tabs from './lib/tabs'\n// @ts-ignore\nimport * as utils from './utils'\nimport * as login from './login/login'\nimport * as widgets from './widgets/index'\nimport { initHeader } from './header'\nimport { initFooter } from './footer'\nimport * as createTypes from './create/types'\n\nexport const dom = typeof window !== 'undefined' ? window.document : null // Idea that UI.dom can be adapted in non-browser environments\n\n// this variables are directly used in the storybook\nexport {\n ns,\n acl,\n aclControl,\n create,\n createTypes,\n icons,\n language,\n log,\n login,\n matrix,\n media,\n messageArea,\n infiniteMessageArea,\n pad,\n participation,\n preferences,\n style,\n table,\n tabs,\n utils,\n widgets,\n initHeader,\n initFooter\n}\n// uses in solid-panes\nexport type { CreateContext, NewAppInstanceOptions } from './create/types'\n\nexport * from './lib/auth'\nexport * from './lib/components'\nexport * from './lib/dialogs'\nexport * from './lib/file-explorer/context'\nexport * from './lib/code-editor'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,IAAa,IAAM,OAAO,SAAW,MAAc,OAAO,WAAW"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { m as e } from "./chunks/index.esm-BW2SOmt6.js";
|
|
2
2
|
import { a as t, c as n, n as r, o as i, s as a, t as o } from "./chunks/auth-IpQoQHJx.js";
|
|
3
3
|
import { l as s, m as c, t as l } from "./chunks/style-_Eni1Wf8.js";
|
|
4
|
-
import {
|
|
5
|
-
import { _ as
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
8
|
-
export { n as Account,
|
|
4
|
+
import { S as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, x as A, y as j } from "./chunks/src-BImdSpRx.js";
|
|
5
|
+
import { _ as M, a as N, g as P, h as F, m as I, n as L, o as R, t as z, v as B, y as V } from "./chunks/components-BHoVP7zE.js";
|
|
6
|
+
import { n as H, t as U } from "./chunks/dialogs-D2n-R0lI.js";
|
|
7
|
+
import { t as W } from "./chunks/show-dialog-eEW5yRBv.js";
|
|
8
|
+
export { n as Account, F as CloseDialogEvent, S as CodeEditor, t as DEFAULT_AUTH_CONTEXT, M as DEFAULT_DIALOG_CONTEXT, o as DEFAULT_SIGNUP_URL, H as Dialog, N as DialogComponent, I as DialogTrait, z as FormControlComponent, L as FormControlTrait, a as NoopAuth, W as ShowDialogEvent, r as SolidAuth, R as WebComponent, d as acl, k as aclControl, i as authContext, _ as create, y as createTypes, P as customElement, B as dialogContext, D as dom, T as fileExplorerContext, V as generateId, u as icons, O as infiniteMessageArea, f as initFooter, C as initHeader, A as language, c as log, j as login, v as matrix, x as media, w as messageArea, e as ns, h as pad, g as participation, b as preferences, U as showDialog, l as style, m as table, E as tabs, s as utils, p as widgets };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
let e=require("@codemirror/state"),t=require("@codemirror/view"),n=require("@codemirror/language"),r=require("@codemirror/commands"),i=require("@codemirror/lang-css"),a=require("@codemirror/lang-html"),o=require("@codemirror/lang-javascript"),s=require("@codemirror/lang-json"),c=require("@codemirror/lang-markdown"),l=require("@codemirror/lang-xml"),u=require("@uiw/codemirror-theme-vscode"),d=require("@codemirror/legacy-modes/mode/turtle"),f=require("@codemirror/legacy-modes/mode/sparql"),p=require("@codemirror/legacy-modes/mode/ntriples");var m=class{_view=null;_languageCompartment=null;_editableCompartment=null;_onDirtyChange;_isDirty=!1;async initialize(i,a=``,o=`text/turtle`,s=`dark`,c){this._view&&this._view.destroy(),this._languageCompartment=new e.Compartment,this._editableCompartment=new e.Compartment,this._onDirtyChange=c,this._isDirty=!1;let l=await this._getLanguageExtension(o),d=e.EditorState.create({doc:a,extensions:[s===`dark`?u.vscodeDark:u.vscodeLight,t.EditorView.theme({"&":{minHeight:`6lh`}}),this._languageCompartment.of(l),this._editableCompartment.of(t.EditorView.editable.of(!0)),(0,n.syntaxHighlighting)(n.defaultHighlightStyle,{fallback:!0}),(0,t.lineNumbers)(),(0,r.history)(),(0,t.drawSelection)(),t.EditorView.lineWrapping,t.EditorView.updateListener.of(e=>{e.docChanged&&!this._isDirty&&(this._isDirty=!0,this._onDirtyChange?.(!0))}),t.keymap.of([...r.defaultKeymap,...r.historyKeymap])]});this._view=new t.EditorView({state:d,parent:i})}destroy(){this._view?.destroy(),this._view=null,this._isDirty=!1}getValue(){return this._view?this._view.state.doc.toString():``}replaceContent(e){this._view&&this._view.state.doc.toString()!==e&&this._view.dispatch({changes:{from:0,to:this._view.state.doc.length,insert:e}})}resetDirtyState(){this._isDirty=!1}setReadOnly(e){if(!this._view)return;let n=this._editableCompartment;n&&this._view.dispatch({effects:n.reconfigure(t.EditorView.editable.of(!e))})}focusEditor(){this._view?.focus()}async setLanguage(e){if(!this._view)return;let t=this._languageCompartment;if(!t)return;let n=await this._getLanguageExtension(e);this._view.dispatch({effects:t.reconfigure(n)})}async _getLanguageExtension(e){switch(e){case`text/turtle`:case`text/n3`:return n.StreamLanguage.define(d.turtle);case`application/sparql-update`:case`application/sparql-query`:return n.StreamLanguage.define(f.sparql);case`application/nquads`:case`application/n-quads`:case`application/n-triples`:return n.StreamLanguage.define(p.ntriples);case`application/json`:case`application/ld+json`:return(0,s.json)();case`text/html`:case`application/xhtml+xml`:return(0,a.html)();case`text/markdown`:case`text/x-markdown`:case`text/md`:return(0,c.markdown)();case`application/rdf+xml`:case`application/xml`:return(0,l.xml)();case`text/css`:return(0,i.css)();case`text/javascript`:case`application/javascript`:case`application/ecmascript`:return(0,o.javascript)();default:return[]}}};exports.CodeEditor=m;
|
|
2
|
+
//# sourceMappingURL=CodeEditor.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.cjs.js","names":[],"sources":["../../../src/lib/code-editor/CodeEditor.ts"],"sourcesContent":["import type { ThemeMode } from 'pane-registry'\nimport { Compartment, EditorState } from '@codemirror/state'\nimport { EditorView, drawSelection, keymap, lineNumbers } from '@codemirror/view'\nimport { defaultHighlightStyle, syntaxHighlighting, StreamLanguage } from '@codemirror/language'\nimport { defaultKeymap, history, historyKeymap } from '@codemirror/commands'\nimport { css } from '@codemirror/lang-css'\nimport { html } from '@codemirror/lang-html'\nimport { javascript } from '@codemirror/lang-javascript'\nimport { json } from '@codemirror/lang-json'\nimport { markdown } from '@codemirror/lang-markdown'\nimport { xml } from '@codemirror/lang-xml'\nimport { vscodeDark, vscodeLight } from '@uiw/codemirror-theme-vscode'\nimport { turtle } from '@codemirror/legacy-modes/mode/turtle'\nimport { sparql } from '@codemirror/legacy-modes/mode/sparql'\nimport { ntriples } from '@codemirror/legacy-modes/mode/ntriples'\n\nexport class CodeEditor {\n private _view: EditorView | null = null\n private _languageCompartment: Compartment | null = null\n private _editableCompartment: Compartment | null = null\n private _onDirtyChange?: (dirty: boolean) => void\n private _isDirty = false\n\n async initialize (container: HTMLElement, initialDoc = '', contentType: string = 'text/turtle', theme: ThemeMode = 'dark', onDirtyChange?: (dirty: boolean) => void) {\n if (this._view) {\n this._view.destroy()\n }\n\n this._languageCompartment = new Compartment()\n this._editableCompartment = new Compartment()\n this._onDirtyChange = onDirtyChange\n this._isDirty = false\n const languageExtension = await this._getLanguageExtension(contentType)\n\n const state = EditorState.create({\n doc: initialDoc,\n extensions: [\n theme === 'dark' ? vscodeDark : vscodeLight,\n EditorView.theme({\n '&': {\n minHeight: '6lh'\n }\n }),\n this._languageCompartment.of(languageExtension),\n this._editableCompartment.of(EditorView.editable.of(true)),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n lineNumbers(),\n history(),\n drawSelection(),\n EditorView.lineWrapping,\n EditorView.updateListener.of((update) => {\n if (update.docChanged && !this._isDirty) {\n this._isDirty = true\n this._onDirtyChange?.(true)\n }\n }),\n keymap.of([\n ...defaultKeymap,\n ...historyKeymap\n ])\n ]\n })\n\n this._view = new EditorView({\n state,\n parent: container\n })\n }\n\n destroy () {\n this._view?.destroy()\n this._view = null\n this._isDirty = false\n }\n\n getValue (): string {\n return this._view ? this._view.state.doc.toString() : ''\n }\n\n replaceContent (text: string) {\n if (!this._view) return\n const current = this._view.state.doc.toString()\n if (current === text) return\n this._view.dispatch({\n changes: { from: 0, to: this._view.state.doc.length, insert: text }\n })\n }\n\n resetDirtyState () {\n this._isDirty = false\n }\n\n setReadOnly (readOnly: boolean) {\n if (!this._view) return\n const editableCompartment = this._editableCompartment\n if (!editableCompartment) return\n this._view.dispatch({\n effects: editableCompartment.reconfigure(EditorView.editable.of(!readOnly))\n })\n }\n\n focusEditor () {\n this._view?.focus()\n }\n\n async setLanguage (contentType: string) {\n if (!this._view) return\n const languageCompartment = this._languageCompartment\n if (!languageCompartment) return\n\n const extension = await this._getLanguageExtension(contentType)\n this._view.dispatch({\n effects: languageCompartment.reconfigure(extension)\n })\n }\n\n private async _getLanguageExtension (contentType: string) {\n switch (contentType) {\n case 'text/turtle':\n case 'text/n3':\n return StreamLanguage.define(turtle)\n\n case 'application/sparql-update':\n case 'application/sparql-query':\n return StreamLanguage.define(sparql)\n\n case 'application/nquads':\n case 'application/n-quads':\n case 'application/n-triples':\n return StreamLanguage.define(ntriples)\n\n case 'application/json':\n case 'application/ld+json':\n return json()\n\n case 'text/html':\n case 'application/xhtml+xml':\n return html()\n\n case 'text/markdown':\n case 'text/x-markdown':\n case 'text/md':\n return markdown()\n\n case 'application/rdf+xml':\n case 'application/xml':\n return xml()\n\n case 'text/css':\n return css()\n\n case 'text/javascript':\n case 'application/javascript':\n case 'application/ecmascript':\n return javascript()\n\n default:\n return []\n }\n }\n}\n"],"mappings":"iiBAgBA,IAAa,EAAb,KAAwB,CACtB,MAAmC,KACnC,qBAAmD,KACnD,qBAAmD,KACnD,eACA,SAAmB,GAEnB,MAAM,WAAY,EAAwB,EAAa,GAAI,EAAsB,cAAe,EAAmB,OAAQ,EAA0C,CAC/J,KAAK,OACP,KAAK,MAAM,QAAQ,EAGrB,KAAK,qBAAuB,IAAI,EAAA,YAChC,KAAK,qBAAuB,IAAI,EAAA,YAChC,KAAK,eAAiB,EACtB,KAAK,SAAW,GAChB,IAAM,EAAoB,MAAM,KAAK,sBAAsB,CAAW,EAEhE,EAAQ,EAAA,YAAY,OAAO,CAC/B,IAAK,EACL,WAAY,CACV,IAAU,OAAS,EAAA,WAAa,EAAA,YAChC,EAAA,WAAW,MAAM,CACf,IAAK,CACH,UAAW,KACb,CACF,CAAC,EACD,KAAK,qBAAqB,GAAG,CAAiB,EAC9C,KAAK,qBAAqB,GAAG,EAAA,WAAW,SAAS,GAAG,EAAI,CAAC,GACzD,EAAA,EAAA,mBAAA,CAAmB,EAAA,sBAAuB,CAAE,SAAU,EAAK,CAAC,GAC5D,EAAA,EAAA,YAAA,CAAY,GACZ,EAAA,EAAA,QAAA,CAAQ,GACR,EAAA,EAAA,cAAA,CAAc,EACd,EAAA,WAAW,aACX,EAAA,WAAW,eAAe,GAAI,GAAW,CACnC,EAAO,YAAc,CAAC,KAAK,WAC7B,KAAK,SAAW,GAChB,KAAK,iBAAiB,EAAI,EAE9B,CAAC,EACD,EAAA,OAAO,GAAG,CACR,GAAG,EAAA,cACH,GAAG,EAAA,aACL,CAAC,CACH,CACF,CAAC,EAED,KAAK,MAAQ,IAAI,EAAA,WAAW,CAC1B,QACA,OAAQ,CACV,CAAC,CACH,CAEA,SAAW,CACT,KAAK,OAAO,QAAQ,EACpB,KA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AO,EAAA,SAAA,CAAS,EAElB,IAAK,sBACL,IAAK,kBACH,OAAA,EAAO,EAAA,IAAA,CAAI,EAEb,IAAK,WACH,OAAA,EAAO,EAAA,IAAA,CAAI,EAEb,IAAK,kBACL,IAAK,yBACL,IAAK,yBACH,OAAA,EAAO,EAAA,WAAA,CAAW,EAEpB,QACE,MAAO,CAAC,CACZ,CACF,CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ThemeMode } from 'pane-registry';
|
|
2
|
+
export declare class CodeEditor {
|
|
3
|
+
private _view;
|
|
4
|
+
private _languageCompartment;
|
|
5
|
+
private _editableCompartment;
|
|
6
|
+
private _onDirtyChange?;
|
|
7
|
+
private _isDirty;
|
|
8
|
+
initialize(container: HTMLElement, initialDoc?: string, contentType?: string, theme?: ThemeMode, onDirtyChange?: (dirty: boolean) => void): Promise<void>;
|
|
9
|
+
destroy(): void;
|
|
10
|
+
getValue(): string;
|
|
11
|
+
replaceContent(text: string): void;
|
|
12
|
+
resetDirtyState(): void;
|
|
13
|
+
setReadOnly(readOnly: boolean): void;
|
|
14
|
+
focusEditor(): void;
|
|
15
|
+
setLanguage(contentType: string): Promise<void>;
|
|
16
|
+
private _getLanguageExtension;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=CodeEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.d.ts","sourceRoot":"","sources":["../../../src/lib/code-editor/CodeEditor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAgB9C,qBAAa,UAAU;IACrB,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,oBAAoB,CAA2B;IACvD,OAAO,CAAC,oBAAoB,CAA2B;IACvD,OAAO,CAAC,cAAc,CAAC,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAQ;IAElB,UAAU,CAAE,SAAS,EAAE,WAAW,EAAE,UAAU,SAAK,EAAE,WAAW,GAAE,MAAsB,EAAE,KAAK,GAAE,SAAkB,EAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;IA8CnK,OAAO;IAMP,QAAQ,IAAK,MAAM;IAInB,cAAc,CAAE,IAAI,EAAE,MAAM;IAS5B,eAAe;IAIf,WAAW,CAAE,QAAQ,EAAE,OAAO;IAS9B,WAAW;IAIL,WAAW,CAAE,WAAW,EAAE,MAAM;YAWxB,qBAAqB;CA4CpC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Compartment as e, EditorState as t } from "@codemirror/state";
|
|
2
|
+
import { EditorView as n, drawSelection as r, keymap as i, lineNumbers as a } from "@codemirror/view";
|
|
3
|
+
import { StreamLanguage as o, defaultHighlightStyle as s, syntaxHighlighting as c } from "@codemirror/language";
|
|
4
|
+
import { defaultKeymap as l, history as u, historyKeymap as d } from "@codemirror/commands";
|
|
5
|
+
import { css as f } from "@codemirror/lang-css";
|
|
6
|
+
import { html as p } from "@codemirror/lang-html";
|
|
7
|
+
import { javascript as m } from "@codemirror/lang-javascript";
|
|
8
|
+
import { json as h } from "@codemirror/lang-json";
|
|
9
|
+
import { markdown as g } from "@codemirror/lang-markdown";
|
|
10
|
+
import { xml as _ } from "@codemirror/lang-xml";
|
|
11
|
+
import { vscodeDark as v, vscodeLight as y } from "@uiw/codemirror-theme-vscode";
|
|
12
|
+
import { turtle as b } from "@codemirror/legacy-modes/mode/turtle";
|
|
13
|
+
import { sparql as x } from "@codemirror/legacy-modes/mode/sparql";
|
|
14
|
+
import { ntriples as S } from "@codemirror/legacy-modes/mode/ntriples";
|
|
15
|
+
//#region src/lib/code-editor/CodeEditor.ts
|
|
16
|
+
var C = class {
|
|
17
|
+
_view = null;
|
|
18
|
+
_languageCompartment = null;
|
|
19
|
+
_editableCompartment = null;
|
|
20
|
+
_onDirtyChange;
|
|
21
|
+
_isDirty = !1;
|
|
22
|
+
async initialize(o, f = "", p = "text/turtle", m = "dark", h) {
|
|
23
|
+
this._view && this._view.destroy(), this._languageCompartment = new e(), this._editableCompartment = new e(), this._onDirtyChange = h, this._isDirty = !1;
|
|
24
|
+
let g = await this._getLanguageExtension(p), _ = t.create({
|
|
25
|
+
doc: f,
|
|
26
|
+
extensions: [
|
|
27
|
+
m === "dark" ? v : y,
|
|
28
|
+
n.theme({ "&": { minHeight: "6lh" } }),
|
|
29
|
+
this._languageCompartment.of(g),
|
|
30
|
+
this._editableCompartment.of(n.editable.of(!0)),
|
|
31
|
+
c(s, { fallback: !0 }),
|
|
32
|
+
a(),
|
|
33
|
+
u(),
|
|
34
|
+
r(),
|
|
35
|
+
n.lineWrapping,
|
|
36
|
+
n.updateListener.of((e) => {
|
|
37
|
+
e.docChanged && !this._isDirty && (this._isDirty = !0, this._onDirtyChange?.(!0));
|
|
38
|
+
}),
|
|
39
|
+
i.of([...l, ...d])
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
this._view = new n({
|
|
43
|
+
state: _,
|
|
44
|
+
parent: o
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
destroy() {
|
|
48
|
+
this._view?.destroy(), this._view = null, this._isDirty = !1;
|
|
49
|
+
}
|
|
50
|
+
getValue() {
|
|
51
|
+
return this._view ? this._view.state.doc.toString() : "";
|
|
52
|
+
}
|
|
53
|
+
replaceContent(e) {
|
|
54
|
+
this._view && this._view.state.doc.toString() !== e && this._view.dispatch({ changes: {
|
|
55
|
+
from: 0,
|
|
56
|
+
to: this._view.state.doc.length,
|
|
57
|
+
insert: e
|
|
58
|
+
} });
|
|
59
|
+
}
|
|
60
|
+
resetDirtyState() {
|
|
61
|
+
this._isDirty = !1;
|
|
62
|
+
}
|
|
63
|
+
setReadOnly(e) {
|
|
64
|
+
if (!this._view) return;
|
|
65
|
+
let t = this._editableCompartment;
|
|
66
|
+
t && this._view.dispatch({ effects: t.reconfigure(n.editable.of(!e)) });
|
|
67
|
+
}
|
|
68
|
+
focusEditor() {
|
|
69
|
+
this._view?.focus();
|
|
70
|
+
}
|
|
71
|
+
async setLanguage(e) {
|
|
72
|
+
if (!this._view) return;
|
|
73
|
+
let t = this._languageCompartment;
|
|
74
|
+
if (!t) return;
|
|
75
|
+
let n = await this._getLanguageExtension(e);
|
|
76
|
+
this._view.dispatch({ effects: t.reconfigure(n) });
|
|
77
|
+
}
|
|
78
|
+
async _getLanguageExtension(e) {
|
|
79
|
+
switch (e) {
|
|
80
|
+
case "text/turtle":
|
|
81
|
+
case "text/n3": return o.define(b);
|
|
82
|
+
case "application/sparql-update":
|
|
83
|
+
case "application/sparql-query": return o.define(x);
|
|
84
|
+
case "application/nquads":
|
|
85
|
+
case "application/n-quads":
|
|
86
|
+
case "application/n-triples": return o.define(S);
|
|
87
|
+
case "application/json":
|
|
88
|
+
case "application/ld+json": return h();
|
|
89
|
+
case "text/html":
|
|
90
|
+
case "application/xhtml+xml": return p();
|
|
91
|
+
case "text/markdown":
|
|
92
|
+
case "text/x-markdown":
|
|
93
|
+
case "text/md": return g();
|
|
94
|
+
case "application/rdf+xml":
|
|
95
|
+
case "application/xml": return _();
|
|
96
|
+
case "text/css": return f();
|
|
97
|
+
case "text/javascript":
|
|
98
|
+
case "application/javascript":
|
|
99
|
+
case "application/ecmascript": return m();
|
|
100
|
+
default: return [];
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
105
|
+
export { C as CodeEditor };
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=CodeEditor.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.esm.js","names":[],"sources":["../../../src/lib/code-editor/CodeEditor.ts"],"sourcesContent":["import type { ThemeMode } from 'pane-registry'\nimport { Compartment, EditorState } from '@codemirror/state'\nimport { EditorView, drawSelection, keymap, lineNumbers } from '@codemirror/view'\nimport { defaultHighlightStyle, syntaxHighlighting, StreamLanguage } from '@codemirror/language'\nimport { defaultKeymap, history, historyKeymap } from '@codemirror/commands'\nimport { css } from '@codemirror/lang-css'\nimport { html } from '@codemirror/lang-html'\nimport { javascript } from '@codemirror/lang-javascript'\nimport { json } from '@codemirror/lang-json'\nimport { markdown } from '@codemirror/lang-markdown'\nimport { xml } from '@codemirror/lang-xml'\nimport { vscodeDark, vscodeLight } from '@uiw/codemirror-theme-vscode'\nimport { turtle } from '@codemirror/legacy-modes/mode/turtle'\nimport { sparql } from '@codemirror/legacy-modes/mode/sparql'\nimport { ntriples } from '@codemirror/legacy-modes/mode/ntriples'\n\nexport class CodeEditor {\n private _view: EditorView | null = null\n private _languageCompartment: Compartment | null = null\n private _editableCompartment: Compartment | null = null\n private _onDirtyChange?: (dirty: boolean) => void\n private _isDirty = false\n\n async initialize (container: HTMLElement, initialDoc = '', contentType: string = 'text/turtle', theme: ThemeMode = 'dark', onDirtyChange?: (dirty: boolean) => void) {\n if (this._view) {\n this._view.destroy()\n }\n\n this._languageCompartment = new Compartment()\n this._editableCompartment = new Compartment()\n this._onDirtyChange = onDirtyChange\n this._isDirty = false\n const languageExtension = await this._getLanguageExtension(contentType)\n\n const state = EditorState.create({\n doc: initialDoc,\n extensions: [\n theme === 'dark' ? vscodeDark : vscodeLight,\n EditorView.theme({\n '&': {\n minHeight: '6lh'\n }\n }),\n this._languageCompartment.of(languageExtension),\n this._editableCompartment.of(EditorView.editable.of(true)),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n lineNumbers(),\n history(),\n drawSelection(),\n EditorView.lineWrapping,\n EditorView.updateListener.of((update) => {\n if (update.docChanged && !this._isDirty) {\n this._isDirty = true\n this._onDirtyChange?.(true)\n }\n }),\n keymap.of([\n ...defaultKeymap,\n ...historyKeymap\n ])\n ]\n })\n\n this._view = new EditorView({\n state,\n parent: container\n })\n }\n\n destroy () {\n this._view?.destroy()\n this._view = null\n this._isDirty = false\n }\n\n getValue (): string {\n return this._view ? this._view.state.doc.toString() : ''\n }\n\n replaceContent (text: string) {\n if (!this._view) return\n const current = this._view.state.doc.toString()\n if (current === text) return\n this._view.dispatch({\n changes: { from: 0, to: this._view.state.doc.length, insert: text }\n })\n }\n\n resetDirtyState () {\n this._isDirty = false\n }\n\n setReadOnly (readOnly: boolean) {\n if (!this._view) return\n const editableCompartment = this._editableCompartment\n if (!editableCompartment) return\n this._view.dispatch({\n effects: editableCompartment.reconfigure(EditorView.editable.of(!readOnly))\n })\n }\n\n focusEditor () {\n this._view?.focus()\n }\n\n async setLanguage (contentType: string) {\n if (!this._view) return\n const languageCompartment = this._languageCompartment\n if (!languageCompartment) return\n\n const extension = await this._getLanguageExtension(contentType)\n this._view.dispatch({\n effects: languageCompartment.reconfigure(extension)\n })\n }\n\n private async _getLanguageExtension (contentType: string) {\n switch (contentType) {\n case 'text/turtle':\n case 'text/n3':\n return StreamLanguage.define(turtle)\n\n case 'application/sparql-update':\n case 'application/sparql-query':\n return StreamLanguage.define(sparql)\n\n case 'application/nquads':\n case 'application/n-quads':\n case 'application/n-triples':\n return StreamLanguage.define(ntriples)\n\n case 'application/json':\n case 'application/ld+json':\n return json()\n\n case 'text/html':\n case 'application/xhtml+xml':\n return html()\n\n case 'text/markdown':\n case 'text/x-markdown':\n case 'text/md':\n return markdown()\n\n case 'application/rdf+xml':\n case 'application/xml':\n return xml()\n\n case 'text/css':\n return css()\n\n case 'text/javascript':\n case 'application/javascript':\n case 'application/ecmascript':\n return javascript()\n\n default:\n return []\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,IAAa,IAAb,MAAwB;CACtB,QAAmC;CACnC,uBAAmD;CACnD,uBAAmD;CACnD;CACA,WAAmB;CAEnB,MAAM,WAAY,GAAwB,IAAa,IAAI,IAAsB,eAAe,IAAmB,QAAQ,GAA0C;EAQnK,AAPI,KAAK,SACP,KAAK,MAAM,QAAQ,GAGrB,KAAK,uBAAuB,IAAI,EAAY,GAC5C,KAAK,uBAAuB,IAAI,EAAY,GAC5C,KAAK,iBAAiB,GACtB,KAAK,WAAW;EAChB,IAAM,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AAM,YAAa,GAAqB;EACtC,IAAI,CAAC,KAAK,OAAO;EACjB,IAAM,IAAsB,KAAK;EACjC,IAAI,CAAC,GAAqB;EAE1B,IAAM,IAAY,MAAM,KAAK,sBAAsB,CAAW;EAC9D,KAAK,MAAM,SAAS,EAClB,SAAS,EAAoB,YAAY,CAAS,EACpD,CAAC;CACH;CAEA,MAAc,sBAAuB,GAAqB;EACxD,QAAQ,GAAR;GACE,KAAK;GACL,KAAK,WACH,OAAO,EAAe,OAAO,CAAM;GAErC,KAAK;GACL,KAAK,4BACH,OAAO,EAAe,OAAO,CAAM;GAErC,KAAK;GACL,KAAK;GACL,KAAK,yBACH,OAAO,EAAe,OAAO,CAAQ;GAEvC,KAAK;GACL,KAAK,uBACH,OAAO,EAAK;GAEd,KAAK;GACL,KAAK,yBACH,OAAO,EAAK;GAEd,KAAK;GACL,KAAK;GACL,KAAK,WACH,OAAO,EAAS;GAElB,KAAK;GACL,KAAK,mBACH,OAAO,EAAI;GAEb,KAAK,YACH,OAAO,EAAI;GAEb,KAAK;GACL,KAAK;GACL,KAAK,0BACH,OAAO,EAAW;GAEpB,SACE,OAAO,CAAC;EACZ;CACF;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./CodeEditor.cjs.js");exports.CodeEditor=e.CodeEditor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/code-editor/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
package/dist/loader.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { m as e } from "./chunks/index.esm-BW2SOmt6.js";
|
|
2
2
|
import { a as t, c as n, n as r, o as i, s as a, t as o } from "./chunks/auth-IpQoQHJx.js";
|
|
3
3
|
import { l as s, m as c, t as l } from "./chunks/style-_Eni1Wf8.js";
|
|
4
|
-
import {
|
|
5
|
-
import { _ as
|
|
6
|
-
import { n as
|
|
7
|
-
import { t as
|
|
4
|
+
import { S as u, _ as d, a as f, b as p, c as m, d as h, f as g, g as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O, v as k, x as A, y as j } from "./chunks/src-BImdSpRx.js";
|
|
5
|
+
import { _ as M, a as N, g as P, h as F, m as I, n as L, o as R, t as z, v as B, y as V } from "./chunks/components-BHoVP7zE.js";
|
|
6
|
+
import { n as H, t as U } from "./chunks/dialogs-D2n-R0lI.js";
|
|
7
|
+
import { t as W } from "./chunks/show-dialog-eEW5yRBv.js";
|
|
8
8
|
import "./components.js";
|
|
9
|
-
export { n as Account,
|
|
9
|
+
export { n as Account, F as CloseDialogEvent, S as CodeEditor, t as DEFAULT_AUTH_CONTEXT, M as DEFAULT_DIALOG_CONTEXT, o as DEFAULT_SIGNUP_URL, H as Dialog, N as DialogComponent, I as DialogTrait, z as FormControlComponent, L as FormControlTrait, a as NoopAuth, W as ShowDialogEvent, r as SolidAuth, R as WebComponent, d as acl, k as aclControl, i as authContext, _ as create, y as createTypes, P as customElement, B as dialogContext, D as dom, T as fileExplorerContext, V as generateId, u as icons, O as infiniteMessageArea, f as initFooter, C as initHeader, A as language, c as log, j as login, v as matrix, x as media, w as messageArea, e as ns, h as pad, g as participation, b as preferences, U as showDialog, l as style, m as table, E as tabs, s as utils, p as widgets };
|