@onereach/ui-components 4.10.0 → 4.10.1-beta.2921.0
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/bundled/v2/components/OrCode/OrCode.js +4 -3792
- package/dist/bundled/v2/components/OrCode/index.js +4 -2
- package/dist/bundled/v2/components/OrCode/lang.js +24 -3
- package/dist/bundled/v2/components/OrCode/theme.js +1 -1
- package/dist/bundled/v2/components/OrCodeV3/OrCode.js +333 -0
- package/dist/bundled/v2/components/OrCodeV3/OrCode.vue.d.ts +169 -0
- package/dist/bundled/v2/components/OrCodeV3/index.d.ts +2 -0
- package/dist/bundled/v2/components/OrCodeV3/index.js +49 -0
- package/dist/bundled/v2/components/OrCodeV3/props.d.ts +8 -0
- package/dist/bundled/v2/components/OrCodeV3/props.js +11 -0
- package/dist/bundled/v2/components/OrCodeV3/styles.d.ts +2 -0
- package/dist/bundled/v2/components/OrCodeV3/styles.js +10 -0
- package/dist/bundled/v2/components/OrModalV3/OrModal.js +2 -2
- package/dist/bundled/v2/components/index.d.ts +1 -0
- package/dist/bundled/v2/components/index.js +8 -3
- package/dist/bundled/{v3/OrCode.vue_vue_type_script_lang-46846a36.js → v2/index-576b3dec.js} +3 -235
- package/dist/bundled/v2/{index-cf2c3c27.js → index-6a13fa4e.js} +1 -1
- package/dist/bundled/v2/{lang-0fb8f78b.js → index-eba9b646.js} +2 -22
- package/dist/bundled/v2/index.js +9 -4
- package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-1812e6e4.js +237 -0
- package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-84a512fb.js +200 -0
- package/dist/bundled/v3/components/OrCode/OrCode.js +7 -5
- package/dist/bundled/v3/components/OrCode/index.js +5 -3
- package/dist/bundled/v3/components/OrCode/lang.js +24 -3
- package/dist/bundled/v3/components/OrCode/theme.js +1 -1
- package/dist/bundled/v3/components/OrCodeV3/OrCode.js +142 -0
- package/dist/bundled/v3/components/OrCodeV3/OrCode.vue.d.ts +119 -0
- package/dist/bundled/v3/components/OrCodeV3/index.d.ts +2 -0
- package/dist/bundled/v3/components/OrCodeV3/index.js +60 -0
- package/dist/bundled/v3/components/OrCodeV3/props.d.ts +8 -0
- package/dist/bundled/v3/components/OrCodeV3/props.js +11 -0
- package/dist/bundled/v3/components/OrCodeV3/styles.d.ts +2 -0
- package/dist/bundled/v3/components/OrCodeV3/styles.js +10 -0
- package/dist/bundled/v3/components/index.d.ts +1 -0
- package/dist/bundled/v3/components/index.js +10 -4
- package/dist/bundled/v3/index-576b3dec.js +3794 -0
- package/dist/bundled/v3/{index-cf2c3c27.js → index-6a13fa4e.js} +1 -1
- package/dist/bundled/v3/{lang-0fb8f78b.js → index-eba9b646.js} +2 -22
- package/dist/bundled/v3/index.js +16 -10
- package/dist/esm/v2/OrCode-ad718022.js +327 -0
- package/dist/esm/v2/components/index.d.ts +1 -0
- package/dist/esm/v2/components/index.js +2 -1
- package/dist/esm/v2/components/or-code-v3/OrCode.vue.d.ts +169 -0
- package/dist/esm/v2/components/or-code-v3/index.d.ts +2 -0
- package/dist/esm/v2/components/or-code-v3/index.js +35 -0
- package/dist/esm/v2/components/or-code-v3/props.d.ts +8 -0
- package/dist/esm/v2/components/or-code-v3/styles.d.ts +2 -0
- package/dist/esm/v2/index.js +1 -0
- package/dist/esm/v3/OrCode-8ccd5dc7.js +301 -0
- package/dist/esm/v3/components/index.d.ts +1 -0
- package/dist/esm/v3/components/index.js +2 -1
- package/dist/esm/v3/components/or-code-v3/OrCode.vue.d.ts +119 -0
- package/dist/esm/v3/components/or-code-v3/index.d.ts +2 -0
- package/dist/esm/v3/components/or-code-v3/index.js +33 -0
- package/dist/esm/v3/components/or-code-v3/props.d.ts +8 -0
- package/dist/esm/v3/components/or-code-v3/styles.d.ts +2 -0
- package/dist/esm/v3/index.js +1 -0
- package/package.json +2 -3
- package/src/components/index.ts +1 -0
- package/src/components/or-code-v3/OrCode.vue +338 -0
- package/src/components/or-code-v3/index.ts +2 -0
- package/src/components/or-code-v3/props.ts +8 -0
- package/src/components/or-code-v3/styles.ts +12 -0
|
@@ -18388,4 +18388,4 @@ function createTokenType(extra, tagStr) {
|
|
|
18388
18388
|
return type.id;
|
|
18389
18389
|
}
|
|
18390
18390
|
|
|
18391
|
-
export {
|
|
18391
|
+
export { tags as $, Annotation as A, highlightActiveLineGutter as B, ChangeSet as C, Direction as D, EditorView as E, Facet as F, highlightSpecialChars as G, foldGutter as H, IndentContext as I, drawSelection as J, dropCursor as K, indentOnInput as L, syntaxHighlighting as M, NodeProp as N, defaultHighlightStyle as O, Prec as P, bracketMatching as Q, RangeSetBuilder as R, StateField as S, Transaction as T, rectangularSelection as U, ViewPlugin as V, WidgetType as W, crosshairCursor as X, highlightActiveLine as Y, foldKeymap as Z, HighlightStyle as _, EditorState as a, showTooltip as a0, getTooltip as a1, MapMode as a2, RangeValue as a3, RangeSet as a4, Parser as a5, NodeSet as a6, NodeType as a7, DefaultBufferLength as a8, Tree as a9, IterMode as aa, styleTags as ab, parseMixed as ac, LanguageSupport as ad, LRLanguage as ae, indentNodeProp as af, continuedIndent as ag, foldNodeProp as ah, foldInside as ai, flatIndent as aj, delimitedIndent as ak, NodeWeakMap as al, Tag as am, Language as an, defineLanguageFacet as ao, languageDataProp as ap, LanguageDescription as aq, ParseContext as ar, EditorSelection as b, combineConfig as c, ChangeDesc as d, Text as e, indentUnit as f, getIndentation as g, countColumn as h, indentString as i, getIndentUnit as j, keymap as k, StateEffect as l, matchBrackets as m, findClusterBreak as n, Decoration as o, codePointAt as p, codePointSize as q, getPanel as r, syntaxTree as s, CharCategory as t, fromCodePoint as u, showPanel as v, runScopeHandlers as w, hoverTooltip as x, logException as y, lineNumbers as z };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { s as syntaxTree, E as EditorView,
|
|
2
|
-
import { OrCodeLanguages } from './components/OrCode/constants.js';
|
|
1
|
+
import { s as syntaxTree, E as EditorView, q as codePointSize, p as codePointAt, b as EditorSelection, t as CharCategory, P as Prec, k as keymap, F as Facet, c as combineConfig, S as StateField, a0 as showTooltip, a1 as getTooltip, V as ViewPlugin, y as logException, l as StateEffect, a2 as MapMode, a3 as RangeValue, a4 as RangeSet, u as fromCodePoint, A as Annotation, e as Text, f as indentUnit, o as Decoration, D as Direction, W as WidgetType, a5 as Parser, a6 as NodeSet, a7 as NodeType, a8 as DefaultBufferLength, N as NodeProp, a9 as Tree, aa as IterMode, ab as styleTags, $ as tags$1, ac as parseMixed, ad as LanguageSupport, ae as LRLanguage, af as indentNodeProp, ag as continuedIndent, ah as foldNodeProp, ai as foldInside, aj as flatIndent, ak as delimitedIndent, al as NodeWeakMap, am as Tag, an as Language, ao as defineLanguageFacet, ap as languageDataProp, aq as LanguageDescription, ar as ParseContext } from './index-6a13fa4e.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
An instance of this is passed to completion source functions.
|
|
@@ -7868,23 +7867,4 @@ function markdown() {
|
|
|
7868
7867
|
return new LanguageSupport(mkLang(parser.configure(extensions)), support);
|
|
7869
7868
|
}
|
|
7870
7869
|
|
|
7871
|
-
|
|
7872
|
-
typescript: false
|
|
7873
|
-
});
|
|
7874
|
-
const TS = javascript({
|
|
7875
|
-
typescript: true
|
|
7876
|
-
});
|
|
7877
|
-
const CSS = css();
|
|
7878
|
-
const HTML = html();
|
|
7879
|
-
const JSON$1 = json();
|
|
7880
|
-
const MD = markdown();
|
|
7881
|
-
var languages = {
|
|
7882
|
-
[OrCodeLanguages.JS]: JS,
|
|
7883
|
-
[OrCodeLanguages.TS]: TS,
|
|
7884
|
-
[OrCodeLanguages.CSS]: CSS,
|
|
7885
|
-
[OrCodeLanguages.HTML]: HTML,
|
|
7886
|
-
[OrCodeLanguages.JSON]: JSON$1,
|
|
7887
|
-
[OrCodeLanguages.MD]: MD
|
|
7888
|
-
};
|
|
7889
|
-
|
|
7890
|
-
export { CSS as C, HTML as H, JS as J, MD as M, TS as T, autocompletion as a, closeBracketsKeymap as b, closeBrackets as c, completionKeymap as d, JSON$1 as e, languages as l };
|
|
7870
|
+
export { javascript as a, closeBrackets as b, css as c, autocompletion as d, closeBracketsKeymap as e, completionKeymap as f, html as h, json as j, markdown as m };
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -22,7 +22,9 @@ export { s as OrCheckboxGroupV3 } from './OrCheckboxGroup.vue_vue_type_script_la
|
|
|
22
22
|
import './components/OrChips/OrChips.js';
|
|
23
23
|
export { s as OrChips } from './OrChips.vue_vue_type_script_lang-d7a38038.js';
|
|
24
24
|
import './components/OrCode/OrCode.js';
|
|
25
|
-
export { s as OrCode } from './OrCode.vue_vue_type_script_lang-
|
|
25
|
+
export { s as OrCode } from './OrCode.vue_vue_type_script_lang-1812e6e4.js';
|
|
26
|
+
import './components/OrCodeV3/OrCode.js';
|
|
27
|
+
export { s as OrCodeV3 } from './OrCode.vue_vue_type_script_lang-84a512fb.js';
|
|
26
28
|
import './components/OrColorPicker/OrColorPicker.js';
|
|
27
29
|
export { s as OrColorPicker } from './OrColorPicker.vue_vue_type_script_lang-2e1845d8.js';
|
|
28
30
|
import './components/OrCombinedInputV3/OrCombinedInput.js';
|
|
@@ -53,8 +55,6 @@ import './components/OrLinkV3/OrLink.js';
|
|
|
53
55
|
export { s as OrLinkV3 } from './OrLink.vue_vue_type_script_lang-2d66ea4d.js';
|
|
54
56
|
import './components/OrListOfInputs/OrListOfInputs.js';
|
|
55
57
|
export { s as OrListOfInputs } from './OrListOfInputs.vue_vue_type_script_lang-04af76e1.js';
|
|
56
|
-
import './components/OrModalV3/OrModal.js';
|
|
57
|
-
export { s as OrModalV3 } from './OrModal.vue_vue_type_script_lang-83469d51.js';
|
|
58
58
|
import './components/OrNotification/OrNotification.js';
|
|
59
59
|
export { s as OrNotification } from './OrNotification.vue_vue_type_script_lang-86084f5e.js';
|
|
60
60
|
import './components/OrNotificationV3/OrNotification.js';
|
|
@@ -151,6 +151,7 @@ export { s as OrCheckboxTreeV3 } from './OrCheckboxTree.vue_vue_type_script_lang
|
|
|
151
151
|
export { s as OrCheckboxV3 } from './OrCheckbox.vue_vue_type_script_lang-616a0cce.js';
|
|
152
152
|
export { s as OrChip } from './OrChip.vue_vue_type_script_lang-d0c62419.js';
|
|
153
153
|
export { OrCodeLanguages } from './components/OrCode/constants.js';
|
|
154
|
+
export { CodeLanguage } from './components/OrCodeV3/props.js';
|
|
154
155
|
export { s as OrCollapse } from './OrCollapse.vue_vue_type_script_lang-e2dcce92.js';
|
|
155
156
|
export { amber, black, blue, blueGrey, brown, cyan, deepOrange, deepPurple, green, indigo, lightBlue, lightGreen, lime, orange, pink, purple, red, teal, white, yellow } from './components/OrColorPicker/constants.js';
|
|
156
157
|
export { InputBoxSize as CombinedInputSize, InputBoxSize as DatePickerSize, InputBoxSize as DateTimePickerSize, InputBoxSize, InputBoxVariant, InputBoxSize as InputSize, InputBoxSize as SearchSize, InputBoxSize as SelectSize, InputBoxSize as TagInputSize, InputBoxSize as TextareaSize, InputBoxSize as TimePickerSize } from './components/OrInputBoxV3/props.js';
|
|
@@ -197,6 +198,7 @@ export { s as OrMenuV3 } from './OrMenu.vue_vue_type_script_lang-8fa5ef6c.js';
|
|
|
197
198
|
export { PopoverPlacement as MenuPlacement, PopoverPlacement, PopoverVariant, PopoverPlacement as TooltipPlacement } from './components/OrPopoverV3/props.js';
|
|
198
199
|
export { s as OrModal } from './OrModal.vue_vue_type_script_lang-153819d3.js';
|
|
199
200
|
export { OrModalSizes } from './components/OrModal/constants.js';
|
|
201
|
+
export { s as OrModalV3 } from './OrModal.vue_vue_type_script_lang-83469d51.js';
|
|
200
202
|
export { ModalSize } from './components/OrModalV3/props.js';
|
|
201
203
|
export { OR_NOTIFICATION_SIZE, OR_NOTIFICATION_TYPE } from './components/OrNotification/constants.js';
|
|
202
204
|
export { NotificationVariant } from './components/OrNotificationV3/props.js';
|
|
@@ -272,17 +274,22 @@ import './components/OrChip/OrChip.js';
|
|
|
272
274
|
import './components/OrChips/constants.js';
|
|
273
275
|
import './components/OrLabel/OrLabel.js';
|
|
274
276
|
import './components/OrError/OrError.js';
|
|
275
|
-
import './index-
|
|
276
|
-
import './
|
|
277
|
+
import './index-6a13fa4e.js';
|
|
278
|
+
import './index-576b3dec.js';
|
|
279
|
+
import './index-eba9b646.js';
|
|
280
|
+
import './components/OrCode/lang.js';
|
|
277
281
|
import './components/OrCode/theme.js';
|
|
278
282
|
import './components/OrModal/OrModal.js';
|
|
279
283
|
import './components/OrHint/OrHint.js';
|
|
280
|
-
import './components/
|
|
281
|
-
import './components/OrFloating/OrFloating.js';
|
|
282
|
-
import './components/OrCombinedInputV3/styles.js';
|
|
284
|
+
import './components/OrCodeV3/styles.js';
|
|
283
285
|
import './components/OrErrorV3/OrError.js';
|
|
284
286
|
import './components/OrHintV3/OrHint.js';
|
|
287
|
+
import './components/OrInputBoxV3/OrInputBox.js';
|
|
285
288
|
import './components/OrLabelV3/OrLabel.js';
|
|
289
|
+
import './components/OrModalV3/OrModal.js';
|
|
290
|
+
import './components/OrColorPicker/utils/defultPalette.js';
|
|
291
|
+
import './components/OrFloating/OrFloating.js';
|
|
292
|
+
import './components/OrCombinedInputV3/styles.js';
|
|
286
293
|
import './index-500b3ace.js';
|
|
287
294
|
import './components/OrButtonV2/OrButton.js';
|
|
288
295
|
import './components/OrInput/OrInput.js';
|
|
@@ -294,7 +301,6 @@ import './OrDateTimePickerMonthSelect-8857f024.js';
|
|
|
294
301
|
import './components/OrDateTimePickerV3/hooks/useDatePlaceholder.js';
|
|
295
302
|
import './OrDateTimePickerPopoverHeader-ec90761f.js';
|
|
296
303
|
import './components/OrDatePickerV3/styles.js';
|
|
297
|
-
import './components/OrInputBoxV3/OrInputBox.js';
|
|
298
304
|
import './components/OrPopoverV3/OrPopover.js';
|
|
299
305
|
import './toString-47fa81b4.js';
|
|
300
306
|
import './isObject-3a5b854d.js';
|
|
@@ -318,7 +324,6 @@ import './components/OrInlineInputBoxV3/OrInlineInputBox.js';
|
|
|
318
324
|
import './components/OrInlineTextareaV3/styles.js';
|
|
319
325
|
import './components/OrLinkV3/styles.js';
|
|
320
326
|
import './components/OrList/OrList.js';
|
|
321
|
-
import './components/OrModalV3/styles.js';
|
|
322
327
|
import './components/OrNotificationV3/styles.js';
|
|
323
328
|
import './components/OrPaginationV3/styles.js';
|
|
324
329
|
import './round-136c7e43.js';
|
|
@@ -380,6 +385,7 @@ import './components/OrLoaderV3/styles.js';
|
|
|
380
385
|
import './components/OrMenuItemV3/styles.js';
|
|
381
386
|
import './components/OrMenuV3/styles.js';
|
|
382
387
|
import './components/OrOverlay/OrOverlay.js';
|
|
388
|
+
import './components/OrModalV3/styles.js';
|
|
383
389
|
import './components/OrOverlayV3/styles.js';
|
|
384
390
|
import './components/OrPopoverV3/styles.js';
|
|
385
391
|
import './components/OrBottomSheetV3/OrBottomSheet.js';
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { indentWithTab } from '@codemirror/commands';
|
|
2
|
+
import { css } from '@codemirror/lang-css';
|
|
3
|
+
import { html } from '@codemirror/lang-html';
|
|
4
|
+
import { javascript } from '@codemirror/lang-javascript';
|
|
5
|
+
import { json } from '@codemirror/lang-json';
|
|
6
|
+
import { markdown } from '@codemirror/lang-markdown';
|
|
7
|
+
import { EditorState } from '@codemirror/state';
|
|
8
|
+
import { EditorView, keymap } from '@codemirror/view';
|
|
9
|
+
import { basicSetup } from 'codemirror';
|
|
10
|
+
import { defineComponent, ref, computed, reactive, watch, onMounted, onUnmounted } from 'vue-demi';
|
|
11
|
+
import { a as useIdAttribute, u as useControlAttributes } from './useIdAttribute-859439f0.js';
|
|
12
|
+
import '@vueuse/core';
|
|
13
|
+
import '@onereach/styles/tailwind.config';
|
|
14
|
+
import 'tailwindcss/resolveConfig';
|
|
15
|
+
import { u as useValidationAttributes } from './useValidationAttributes-d1abbe34.js';
|
|
16
|
+
import { _ as __vue_component__$1 } from './OrError-4ffc1c39.js';
|
|
17
|
+
import { _ as __vue_component__$2 } from './OrHint-aa221198.js';
|
|
18
|
+
import { _ as __vue_component__$3 } from './OrIconButton-ab726d49.js';
|
|
19
|
+
import { _ as __vue_component__$4 } from './OrInputBox-11227ecd.js';
|
|
20
|
+
import './OrInputBox.vue_rollup-plugin-vue_script-1715021a.js';
|
|
21
|
+
import { _ as __vue_component__$5 } from './OrLabel-63380256.js';
|
|
22
|
+
import { _ as __vue_component__$6 } from './OrModal-7b7c35e1.js';
|
|
23
|
+
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
24
|
+
|
|
25
|
+
var CodeLanguage;
|
|
26
|
+
(function (CodeLanguage) {
|
|
27
|
+
CodeLanguage["HTML"] = "html";
|
|
28
|
+
CodeLanguage["CSS"] = "css";
|
|
29
|
+
CodeLanguage["JS"] = "js";
|
|
30
|
+
CodeLanguage["TS"] = "ts";
|
|
31
|
+
CodeLanguage["JSON"] = "json";
|
|
32
|
+
CodeLanguage["MD"] = "md";
|
|
33
|
+
})(CodeLanguage || (CodeLanguage = {}));
|
|
34
|
+
|
|
35
|
+
const Code = [
|
|
36
|
+
// Layout
|
|
37
|
+
'layout-column',
|
|
38
|
+
// Spacing
|
|
39
|
+
'gap-xs'];
|
|
40
|
+
const CodeControl = [
|
|
41
|
+
// Layout
|
|
42
|
+
'grow'];
|
|
43
|
+
|
|
44
|
+
var script = defineComponent({
|
|
45
|
+
name: 'OrCode',
|
|
46
|
+
components: {
|
|
47
|
+
OrError: __vue_component__$1,
|
|
48
|
+
OrHint: __vue_component__$2,
|
|
49
|
+
OrIconButton: __vue_component__$3,
|
|
50
|
+
OrInputBox: __vue_component__$4,
|
|
51
|
+
OrLabel: __vue_component__$5,
|
|
52
|
+
OrModal: __vue_component__$6
|
|
53
|
+
},
|
|
54
|
+
model: {
|
|
55
|
+
prop: 'modelValue',
|
|
56
|
+
event: 'update:modelValue'
|
|
57
|
+
},
|
|
58
|
+
props: {
|
|
59
|
+
modelValue: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: undefined
|
|
62
|
+
},
|
|
63
|
+
language: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: CodeLanguage.JS
|
|
66
|
+
},
|
|
67
|
+
extensions: {
|
|
68
|
+
type: Array,
|
|
69
|
+
default: () => [basicSetup]
|
|
70
|
+
},
|
|
71
|
+
label: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: undefined
|
|
74
|
+
},
|
|
75
|
+
hint: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: undefined
|
|
78
|
+
},
|
|
79
|
+
error: {
|
|
80
|
+
type: [String, Boolean],
|
|
81
|
+
default: undefined
|
|
82
|
+
},
|
|
83
|
+
required: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: false
|
|
86
|
+
},
|
|
87
|
+
readonly: {
|
|
88
|
+
type: Boolean,
|
|
89
|
+
default: false
|
|
90
|
+
},
|
|
91
|
+
disabled: {
|
|
92
|
+
type: Boolean,
|
|
93
|
+
default: false
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
emits: ['update:modelValue', 'keydown', 'keyup', 'focus', 'blur'],
|
|
97
|
+
expose: ['root', 'focus', 'blur'],
|
|
98
|
+
setup(props, context) {
|
|
99
|
+
// Refs
|
|
100
|
+
const root = ref();
|
|
101
|
+
const control = ref();
|
|
102
|
+
const fullscreenControl = ref();
|
|
103
|
+
const modal = ref();
|
|
104
|
+
// Styles
|
|
105
|
+
const rootStyles = computed(() => ['or-code-v3', ...Code]);
|
|
106
|
+
const controlStyles = computed(() => [...CodeControl]);
|
|
107
|
+
// State
|
|
108
|
+
const controlAttributes = reactive({
|
|
109
|
+
id: useIdAttribute(),
|
|
110
|
+
...useControlAttributes(),
|
|
111
|
+
...useValidationAttributes()
|
|
112
|
+
});
|
|
113
|
+
const proxyModelValue = computed({
|
|
114
|
+
get: () => props.modelValue,
|
|
115
|
+
set: value => {
|
|
116
|
+
context.emit('update:modelValue', value);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const proxyLanguage = computed(() => {
|
|
120
|
+
switch (props.language) {
|
|
121
|
+
case CodeLanguage.HTML:
|
|
122
|
+
return html();
|
|
123
|
+
case CodeLanguage.CSS:
|
|
124
|
+
return css();
|
|
125
|
+
case CodeLanguage.JS:
|
|
126
|
+
return javascript();
|
|
127
|
+
case CodeLanguage.TS:
|
|
128
|
+
return javascript({
|
|
129
|
+
typescript: true
|
|
130
|
+
});
|
|
131
|
+
case CodeLanguage.JSON:
|
|
132
|
+
return json();
|
|
133
|
+
case CodeLanguage.MD:
|
|
134
|
+
return markdown();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
// Methods
|
|
138
|
+
function focus() {
|
|
139
|
+
var _a;
|
|
140
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
|
|
141
|
+
}
|
|
142
|
+
function blur() {
|
|
143
|
+
var _a;
|
|
144
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
|
|
145
|
+
}
|
|
146
|
+
// #region Codemirror
|
|
147
|
+
const editorView = new EditorView({
|
|
148
|
+
dispatch: transaction => {
|
|
149
|
+
editorView.update([transaction]);
|
|
150
|
+
proxyModelValue.value = String(editorView.state.doc);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
const extensions = computed(() => [...props.extensions, proxyLanguage.value, keymap.of([indentWithTab]), EditorView.editable.of(!props.readonly && !props.disabled), EditorView.domEventHandlers({
|
|
154
|
+
keydown: event => {
|
|
155
|
+
context.emit('keydown', event);
|
|
156
|
+
},
|
|
157
|
+
keyup: event => {
|
|
158
|
+
context.emit('keyup', event);
|
|
159
|
+
},
|
|
160
|
+
focus: event => {
|
|
161
|
+
context.emit('focus', event);
|
|
162
|
+
},
|
|
163
|
+
blur: event => {
|
|
164
|
+
context.emit('blur', event);
|
|
165
|
+
}
|
|
166
|
+
}), EditorView.baseTheme({})]);
|
|
167
|
+
watch([proxyModelValue, extensions], _ref => {
|
|
168
|
+
let [modelValue = '', extensions] = _ref;
|
|
169
|
+
const {
|
|
170
|
+
selection
|
|
171
|
+
} = editorView.state;
|
|
172
|
+
editorView.setState(EditorState.create({
|
|
173
|
+
doc: modelValue,
|
|
174
|
+
extensions,
|
|
175
|
+
selection: selection.ranges.some(range => range.to > modelValue.length) ? {
|
|
176
|
+
anchor: modelValue.length
|
|
177
|
+
} : selection
|
|
178
|
+
}));
|
|
179
|
+
}, {
|
|
180
|
+
immediate: true
|
|
181
|
+
});
|
|
182
|
+
// #endregion
|
|
183
|
+
// Effects
|
|
184
|
+
watch(() => {
|
|
185
|
+
var _a;
|
|
186
|
+
return (_a = modal.value) === null || _a === void 0 ? void 0 : _a.state;
|
|
187
|
+
}, value => {
|
|
188
|
+
setTimeout(() => {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
if (value === 'open') {
|
|
191
|
+
(_a = fullscreenControl.value) === null || _a === void 0 ? void 0 : _a.append(editorView.dom);
|
|
192
|
+
} else {
|
|
193
|
+
(_b = control.value) === null || _b === void 0 ? void 0 : _b.append(editorView.dom);
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
// Lifecycle
|
|
198
|
+
onMounted(() => {
|
|
199
|
+
var _a;
|
|
200
|
+
(_a = control.value) === null || _a === void 0 ? void 0 : _a.append(editorView.dom);
|
|
201
|
+
});
|
|
202
|
+
onUnmounted(() => {
|
|
203
|
+
editorView.destroy();
|
|
204
|
+
});
|
|
205
|
+
return {
|
|
206
|
+
root,
|
|
207
|
+
control,
|
|
208
|
+
fullscreenControl,
|
|
209
|
+
modal,
|
|
210
|
+
rootStyles,
|
|
211
|
+
controlStyles,
|
|
212
|
+
controlAttributes,
|
|
213
|
+
proxyModelValue,
|
|
214
|
+
proxyLanguage,
|
|
215
|
+
focus,
|
|
216
|
+
blur
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
/* script */
|
|
222
|
+
const __vue_script__ = script;
|
|
223
|
+
|
|
224
|
+
/* template */
|
|
225
|
+
var __vue_render__ = function () {
|
|
226
|
+
var _vm = this;
|
|
227
|
+
var _h = _vm.$createElement;
|
|
228
|
+
var _c = _vm._self._c || _h;
|
|
229
|
+
return _c('div', {
|
|
230
|
+
ref: "root",
|
|
231
|
+
class: _vm.rootStyles
|
|
232
|
+
}, [_vm.label ? [_c('OrLabel', {
|
|
233
|
+
attrs: {
|
|
234
|
+
"control-id": _vm.controlAttributes.id,
|
|
235
|
+
"variant": 'input',
|
|
236
|
+
"required": _vm.required,
|
|
237
|
+
"disabled": _vm.disabled
|
|
238
|
+
},
|
|
239
|
+
scopedSlots: _vm._u([{
|
|
240
|
+
key: "addon",
|
|
241
|
+
fn: function () {
|
|
242
|
+
return [_c('div', {
|
|
243
|
+
class: ['layout-row', 'gap-xs']
|
|
244
|
+
}, [_vm._t("addon"), _vm._v(" "), _c('OrIconButton', {
|
|
245
|
+
attrs: {
|
|
246
|
+
"icon": 'fullscreen'
|
|
247
|
+
},
|
|
248
|
+
on: {
|
|
249
|
+
"click": function ($event) {
|
|
250
|
+
$event.stopPropagation();
|
|
251
|
+
return _vm.modal.open();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
})], 2)];
|
|
255
|
+
},
|
|
256
|
+
proxy: true
|
|
257
|
+
}], null, true)
|
|
258
|
+
}, [_vm._v("\n " + _vm._s(_vm.label) + "\n\n ")])] : _vm._e(), _vm._v(" "), _c('OrInputBox', {
|
|
259
|
+
attrs: {
|
|
260
|
+
"size": 'm',
|
|
261
|
+
"invalid": !!_vm.error,
|
|
262
|
+
"readonly": _vm.readonly,
|
|
263
|
+
"disabled": _vm.disabled
|
|
264
|
+
}
|
|
265
|
+
}, [_c('div', {
|
|
266
|
+
ref: "control",
|
|
267
|
+
class: _vm.controlStyles
|
|
268
|
+
})]), _vm._v(" "), _c('div', {
|
|
269
|
+
directives: [{
|
|
270
|
+
name: "show",
|
|
271
|
+
rawName: "v-show",
|
|
272
|
+
value: !_vm.error,
|
|
273
|
+
expression: "!error"
|
|
274
|
+
}],
|
|
275
|
+
class: ['contents']
|
|
276
|
+
}, [_vm.hint ? [_c('OrHint', {
|
|
277
|
+
attrs: {
|
|
278
|
+
"disabled": _vm.disabled
|
|
279
|
+
}
|
|
280
|
+
}, [_vm._v("\n " + _vm._s(_vm.hint) + "\n ")])] : _vm._e()], 2), _vm._v(" "), _c('div', {
|
|
281
|
+
directives: [{
|
|
282
|
+
name: "show",
|
|
283
|
+
rawName: "v-show",
|
|
284
|
+
value: typeof _vm.error === 'string',
|
|
285
|
+
expression: "typeof error === 'string'"
|
|
286
|
+
}],
|
|
287
|
+
class: ['contents']
|
|
288
|
+
}, [_c('OrError', {
|
|
289
|
+
attrs: {
|
|
290
|
+
"disabled": _vm.disabled
|
|
291
|
+
}
|
|
292
|
+
}, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")])], 1), _vm._v(" "), _c('OrModal', {
|
|
293
|
+
ref: "modal"
|
|
294
|
+
}, [_c('OrInputBox', {
|
|
295
|
+
attrs: {
|
|
296
|
+
"size": 'm',
|
|
297
|
+
"invalid": !!_vm.error,
|
|
298
|
+
"readonly": _vm.readonly,
|
|
299
|
+
"disabled": _vm.disabled
|
|
300
|
+
}
|
|
301
|
+
}, [_c('div', {
|
|
302
|
+
ref: "fullscreenControl",
|
|
303
|
+
class: _vm.controlStyles
|
|
304
|
+
})])], 1)], 2);
|
|
305
|
+
};
|
|
306
|
+
var __vue_staticRenderFns__ = [];
|
|
307
|
+
|
|
308
|
+
/* style */
|
|
309
|
+
const __vue_inject_styles__ = undefined;
|
|
310
|
+
/* scoped */
|
|
311
|
+
const __vue_scope_id__ = undefined;
|
|
312
|
+
/* module identifier */
|
|
313
|
+
const __vue_module_identifier__ = undefined;
|
|
314
|
+
/* functional template */
|
|
315
|
+
const __vue_is_functional_template__ = false;
|
|
316
|
+
/* style inject */
|
|
317
|
+
|
|
318
|
+
/* style inject SSR */
|
|
319
|
+
|
|
320
|
+
/* style inject shadow dom */
|
|
321
|
+
|
|
322
|
+
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
323
|
+
render: __vue_render__,
|
|
324
|
+
staticRenderFns: __vue_staticRenderFns__
|
|
325
|
+
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
326
|
+
|
|
327
|
+
export { CodeLanguage as C, __vue_component__ as _ };
|
|
@@ -15,6 +15,7 @@ export * from './or-checkbox-tree-v3';
|
|
|
15
15
|
export * from './or-checkbox-v3';
|
|
16
16
|
export * from './or-chips';
|
|
17
17
|
export * from './or-code';
|
|
18
|
+
export * from './or-code-v3';
|
|
18
19
|
export * from './or-collapse';
|
|
19
20
|
export * from './or-color-picker';
|
|
20
21
|
export * from './or-combined-input-v3';
|
|
@@ -19,6 +19,7 @@ export { _ as OrCheckboxV3 } from '../OrCheckbox-41f2822d.js';
|
|
|
19
19
|
export { _ as OrChip } from '../OrChip-a614bbb9.js';
|
|
20
20
|
export { _ as OrChips } from '../OrChips-bdf51639.js';
|
|
21
21
|
export { _ as OrCode, O as OrCodeLanguages } from '../OrCode-cbd05828.js';
|
|
22
|
+
export { C as CodeLanguage, _ as OrCodeV3 } from '../OrCode-ad718022.js';
|
|
22
23
|
export { _ as OrCollapse } from '../OrCollapse-9b5d590f.js';
|
|
23
24
|
export { _ as OrColorPicker, h as amber, n as black, b as blue, m as blueGrey, k as brown, c as cyan, j as deepOrange, d as deepPurple, g as green, i as indigo, l as lightBlue, e as lightGreen, f as lime, o as orange, p as pink, a as purple, r as red, t as teal, w as white, y as yellow } from '../OrColorPicker-5370585d.js';
|
|
24
25
|
export { _ as OrCombinedInputV3 } from '../OrCombinedInput-ed20e33b.js';
|
|
@@ -142,6 +143,7 @@ import '@codemirror/lang-javascript';
|
|
|
142
143
|
import '@codemirror/lang-markdown';
|
|
143
144
|
import '@codemirror/language';
|
|
144
145
|
import '@lezer/highlight';
|
|
146
|
+
import '../useValidationAttributes-d1abbe34.js';
|
|
145
147
|
import '../px-to-rem-0b26b83e.js';
|
|
146
148
|
import '../dom-f1d55b67.js';
|
|
147
149
|
import 'lodash/isElement';
|
|
@@ -153,7 +155,6 @@ import 'lodash/padStart';
|
|
|
153
155
|
import '@floating-ui/dom';
|
|
154
156
|
import '../OrTooltip.vue_rollup-plugin-vue_styles.0-47985d95.js';
|
|
155
157
|
import 'lodash/isNil';
|
|
156
|
-
import '../useValidationAttributes-d1abbe34.js';
|
|
157
158
|
import '../useResponsive-a02e95b7.js';
|
|
158
159
|
import 'lodash/cloneDeep';
|
|
159
160
|
import 'lodash/isEqual';
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Extension } from '@codemirror/state';
|
|
2
|
+
import { PropType } from 'vue-demi';
|
|
3
|
+
import { CodeLanguage } from './props';
|
|
4
|
+
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
5
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
6
|
+
control: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
7
|
+
fullscreenControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
8
|
+
modal: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
9
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
10
|
+
} | string[], {} & {}, {
|
|
11
|
+
[x: number]: string;
|
|
12
|
+
} | {}, true> | undefined>;
|
|
13
|
+
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
14
|
+
controlStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
15
|
+
controlAttributes: {
|
|
16
|
+
required: boolean | undefined;
|
|
17
|
+
minlength: number | undefined;
|
|
18
|
+
maxlength: number | undefined;
|
|
19
|
+
pattern: string | undefined;
|
|
20
|
+
min: number | undefined;
|
|
21
|
+
max: number | undefined;
|
|
22
|
+
step: number | undefined;
|
|
23
|
+
readonly: boolean | undefined;
|
|
24
|
+
disabled: boolean | undefined;
|
|
25
|
+
'force-state': string | undefined;
|
|
26
|
+
id: string | undefined;
|
|
27
|
+
};
|
|
28
|
+
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
29
|
+
proxyLanguage: import("@vue/composition-api").ComputedRef<import("@codemirror/language").LanguageSupport>;
|
|
30
|
+
focus: () => void;
|
|
31
|
+
blur: () => void;
|
|
32
|
+
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
33
|
+
modelValue: {
|
|
34
|
+
type: StringConstructor;
|
|
35
|
+
default: undefined;
|
|
36
|
+
};
|
|
37
|
+
language: {
|
|
38
|
+
type: PropType<CodeLanguage>;
|
|
39
|
+
default: CodeLanguage;
|
|
40
|
+
};
|
|
41
|
+
extensions: {
|
|
42
|
+
type: PropType<Extension[]>;
|
|
43
|
+
default: () => Extension[];
|
|
44
|
+
};
|
|
45
|
+
label: {
|
|
46
|
+
type: StringConstructor;
|
|
47
|
+
default: undefined;
|
|
48
|
+
};
|
|
49
|
+
hint: {
|
|
50
|
+
type: StringConstructor;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
error: {
|
|
54
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
55
|
+
default: undefined;
|
|
56
|
+
};
|
|
57
|
+
required: {
|
|
58
|
+
type: BooleanConstructor;
|
|
59
|
+
default: boolean;
|
|
60
|
+
};
|
|
61
|
+
readonly: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
65
|
+
disabled: {
|
|
66
|
+
type: BooleanConstructor;
|
|
67
|
+
default: boolean;
|
|
68
|
+
};
|
|
69
|
+
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
70
|
+
modelValue: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: undefined;
|
|
73
|
+
};
|
|
74
|
+
language: {
|
|
75
|
+
type: PropType<CodeLanguage>;
|
|
76
|
+
default: CodeLanguage;
|
|
77
|
+
};
|
|
78
|
+
extensions: {
|
|
79
|
+
type: PropType<Extension[]>;
|
|
80
|
+
default: () => Extension[];
|
|
81
|
+
};
|
|
82
|
+
label: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
default: undefined;
|
|
85
|
+
};
|
|
86
|
+
hint: {
|
|
87
|
+
type: StringConstructor;
|
|
88
|
+
default: undefined;
|
|
89
|
+
};
|
|
90
|
+
error: {
|
|
91
|
+
type: (BooleanConstructor | StringConstructor)[];
|
|
92
|
+
default: undefined;
|
|
93
|
+
};
|
|
94
|
+
required: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
98
|
+
readonly: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
default: boolean;
|
|
101
|
+
};
|
|
102
|
+
disabled: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
106
|
+
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
107
|
+
modelValue: string;
|
|
108
|
+
language: CodeLanguage;
|
|
109
|
+
extensions: Extension[];
|
|
110
|
+
label: string;
|
|
111
|
+
hint: string;
|
|
112
|
+
error: string | boolean;
|
|
113
|
+
required: boolean;
|
|
114
|
+
readonly: boolean;
|
|
115
|
+
disabled: boolean;
|
|
116
|
+
} & {} & {
|
|
117
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
118
|
+
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
119
|
+
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
120
|
+
control: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
121
|
+
fullscreenControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
122
|
+
modal: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
123
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
124
|
+
} | string[], {} & {}, {
|
|
125
|
+
[x: number]: string;
|
|
126
|
+
} | {}, true> | undefined>;
|
|
127
|
+
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
128
|
+
controlStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
129
|
+
controlAttributes: {
|
|
130
|
+
required: boolean | undefined;
|
|
131
|
+
minlength: number | undefined;
|
|
132
|
+
maxlength: number | undefined;
|
|
133
|
+
pattern: string | undefined;
|
|
134
|
+
min: number | undefined;
|
|
135
|
+
max: number | undefined;
|
|
136
|
+
step: number | undefined;
|
|
137
|
+
readonly: boolean | undefined;
|
|
138
|
+
disabled: boolean | undefined;
|
|
139
|
+
'force-state': string | undefined;
|
|
140
|
+
id: string | undefined;
|
|
141
|
+
};
|
|
142
|
+
proxyModelValue: import("@vue/composition-api").WritableComputedRef<string>;
|
|
143
|
+
proxyLanguage: import("@vue/composition-api").ComputedRef<import("@codemirror/language").LanguageSupport>;
|
|
144
|
+
focus: () => void;
|
|
145
|
+
blur: () => void;
|
|
146
|
+
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
147
|
+
modelValue: string;
|
|
148
|
+
language: CodeLanguage;
|
|
149
|
+
extensions: Extension[];
|
|
150
|
+
label: string;
|
|
151
|
+
hint: string;
|
|
152
|
+
error: string | boolean;
|
|
153
|
+
required: boolean;
|
|
154
|
+
readonly: boolean;
|
|
155
|
+
disabled: boolean;
|
|
156
|
+
} & {} & {
|
|
157
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
158
|
+
}, {
|
|
159
|
+
modelValue: string;
|
|
160
|
+
language: CodeLanguage;
|
|
161
|
+
extensions: Extension[];
|
|
162
|
+
label: string;
|
|
163
|
+
hint: string;
|
|
164
|
+
error: string | boolean;
|
|
165
|
+
required: boolean;
|
|
166
|
+
readonly: boolean;
|
|
167
|
+
disabled: boolean;
|
|
168
|
+
}, true>);
|
|
169
|
+
export default _default;
|