@onereach/ui-components 4.10.1-beta.2921.0 → 4.10.1

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.
Files changed (63) hide show
  1. package/dist/bundled/v2/components/OrCode/OrCode.js +3792 -4
  2. package/dist/bundled/v2/components/OrCode/index.js +2 -4
  3. package/dist/bundled/v2/components/OrCode/lang.js +3 -24
  4. package/dist/bundled/v2/components/OrCode/theme.js +1 -1
  5. package/dist/bundled/v2/components/OrModalV3/OrModal.js +2 -2
  6. package/dist/bundled/v2/components/index.d.ts +0 -1
  7. package/dist/bundled/v2/components/index.js +3 -8
  8. package/dist/bundled/v2/{index-6a13fa4e.js → index-cf2c3c27.js} +1 -1
  9. package/dist/bundled/v2/index.js +4 -9
  10. package/dist/bundled/v2/{index-eba9b646.js → lang-0fb8f78b.js} +22 -2
  11. package/dist/bundled/{v2/index-576b3dec.js → v3/OrCode.vue_vue_type_script_lang-46846a36.js} +235 -3
  12. package/dist/bundled/v3/components/OrCode/OrCode.js +5 -7
  13. package/dist/bundled/v3/components/OrCode/index.js +3 -5
  14. package/dist/bundled/v3/components/OrCode/lang.js +3 -24
  15. package/dist/bundled/v3/components/OrCode/theme.js +1 -1
  16. package/dist/bundled/v3/components/index.d.ts +0 -1
  17. package/dist/bundled/v3/components/index.js +4 -10
  18. package/dist/bundled/v3/{index-6a13fa4e.js → index-cf2c3c27.js} +1 -1
  19. package/dist/bundled/v3/index.js +10 -16
  20. package/dist/bundled/v3/{index-eba9b646.js → lang-0fb8f78b.js} +22 -2
  21. package/dist/esm/v2/components/index.d.ts +0 -1
  22. package/dist/esm/v2/components/index.js +1 -2
  23. package/dist/esm/v2/index.js +0 -1
  24. package/dist/esm/v3/components/index.d.ts +0 -1
  25. package/dist/esm/v3/components/index.js +1 -2
  26. package/dist/esm/v3/index.js +0 -1
  27. package/package.json +4 -3
  28. package/src/components/index.ts +0 -1
  29. package/dist/bundled/v2/components/OrCodeV3/OrCode.js +0 -333
  30. package/dist/bundled/v2/components/OrCodeV3/OrCode.vue.d.ts +0 -169
  31. package/dist/bundled/v2/components/OrCodeV3/index.d.ts +0 -2
  32. package/dist/bundled/v2/components/OrCodeV3/index.js +0 -49
  33. package/dist/bundled/v2/components/OrCodeV3/props.d.ts +0 -8
  34. package/dist/bundled/v2/components/OrCodeV3/props.js +0 -11
  35. package/dist/bundled/v2/components/OrCodeV3/styles.d.ts +0 -2
  36. package/dist/bundled/v2/components/OrCodeV3/styles.js +0 -10
  37. package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-1812e6e4.js +0 -237
  38. package/dist/bundled/v3/OrCode.vue_vue_type_script_lang-84a512fb.js +0 -200
  39. package/dist/bundled/v3/components/OrCodeV3/OrCode.js +0 -142
  40. package/dist/bundled/v3/components/OrCodeV3/OrCode.vue.d.ts +0 -119
  41. package/dist/bundled/v3/components/OrCodeV3/index.d.ts +0 -2
  42. package/dist/bundled/v3/components/OrCodeV3/index.js +0 -60
  43. package/dist/bundled/v3/components/OrCodeV3/props.d.ts +0 -8
  44. package/dist/bundled/v3/components/OrCodeV3/props.js +0 -11
  45. package/dist/bundled/v3/components/OrCodeV3/styles.d.ts +0 -2
  46. package/dist/bundled/v3/components/OrCodeV3/styles.js +0 -10
  47. package/dist/bundled/v3/index-576b3dec.js +0 -3794
  48. package/dist/esm/v2/OrCode-ad718022.js +0 -327
  49. package/dist/esm/v2/components/or-code-v3/OrCode.vue.d.ts +0 -169
  50. package/dist/esm/v2/components/or-code-v3/index.d.ts +0 -2
  51. package/dist/esm/v2/components/or-code-v3/index.js +0 -35
  52. package/dist/esm/v2/components/or-code-v3/props.d.ts +0 -8
  53. package/dist/esm/v2/components/or-code-v3/styles.d.ts +0 -2
  54. package/dist/esm/v3/OrCode-8ccd5dc7.js +0 -301
  55. package/dist/esm/v3/components/or-code-v3/OrCode.vue.d.ts +0 -119
  56. package/dist/esm/v3/components/or-code-v3/index.d.ts +0 -2
  57. package/dist/esm/v3/components/or-code-v3/index.js +0 -33
  58. package/dist/esm/v3/components/or-code-v3/props.d.ts +0 -8
  59. package/dist/esm/v3/components/or-code-v3/styles.d.ts +0 -2
  60. package/src/components/or-code-v3/OrCode.vue +0 -338
  61. package/src/components/or-code-v3/index.ts +0 -2
  62. package/src/components/or-code-v3/props.ts +0 -8
  63. package/src/components/or-code-v3/styles.ts +0 -12
@@ -22,9 +22,7 @@ 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-1812e6e4.js';
26
- import './components/OrCodeV3/OrCode.js';
27
- export { s as OrCodeV3 } from './OrCode.vue_vue_type_script_lang-84a512fb.js';
25
+ export { s as OrCode } from './OrCode.vue_vue_type_script_lang-46846a36.js';
28
26
  import './components/OrColorPicker/OrColorPicker.js';
29
27
  export { s as OrColorPicker } from './OrColorPicker.vue_vue_type_script_lang-2e1845d8.js';
30
28
  import './components/OrCombinedInputV3/OrCombinedInput.js';
@@ -55,6 +53,8 @@ import './components/OrLinkV3/OrLink.js';
55
53
  export { s as OrLinkV3 } from './OrLink.vue_vue_type_script_lang-2d66ea4d.js';
56
54
  import './components/OrListOfInputs/OrListOfInputs.js';
57
55
  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,7 +151,6 @@ 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';
155
154
  export { s as OrCollapse } from './OrCollapse.vue_vue_type_script_lang-e2dcce92.js';
156
155
  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';
157
156
  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';
@@ -198,7 +197,6 @@ export { s as OrMenuV3 } from './OrMenu.vue_vue_type_script_lang-8fa5ef6c.js';
198
197
  export { PopoverPlacement as MenuPlacement, PopoverPlacement, PopoverVariant, PopoverPlacement as TooltipPlacement } from './components/OrPopoverV3/props.js';
199
198
  export { s as OrModal } from './OrModal.vue_vue_type_script_lang-153819d3.js';
200
199
  export { OrModalSizes } from './components/OrModal/constants.js';
201
- export { s as OrModalV3 } from './OrModal.vue_vue_type_script_lang-83469d51.js';
202
200
  export { ModalSize } from './components/OrModalV3/props.js';
203
201
  export { OR_NOTIFICATION_SIZE, OR_NOTIFICATION_TYPE } from './components/OrNotification/constants.js';
204
202
  export { NotificationVariant } from './components/OrNotificationV3/props.js';
@@ -274,22 +272,17 @@ import './components/OrChip/OrChip.js';
274
272
  import './components/OrChips/constants.js';
275
273
  import './components/OrLabel/OrLabel.js';
276
274
  import './components/OrError/OrError.js';
277
- import './index-6a13fa4e.js';
278
- import './index-576b3dec.js';
279
- import './index-eba9b646.js';
280
- import './components/OrCode/lang.js';
275
+ import './index-cf2c3c27.js';
276
+ import './lang-0fb8f78b.js';
281
277
  import './components/OrCode/theme.js';
282
278
  import './components/OrModal/OrModal.js';
283
279
  import './components/OrHint/OrHint.js';
284
- import './components/OrCodeV3/styles.js';
285
- import './components/OrErrorV3/OrError.js';
286
- import './components/OrHintV3/OrHint.js';
287
- import './components/OrInputBoxV3/OrInputBox.js';
288
- import './components/OrLabelV3/OrLabel.js';
289
- import './components/OrModalV3/OrModal.js';
290
280
  import './components/OrColorPicker/utils/defultPalette.js';
291
281
  import './components/OrFloating/OrFloating.js';
292
282
  import './components/OrCombinedInputV3/styles.js';
283
+ import './components/OrErrorV3/OrError.js';
284
+ import './components/OrHintV3/OrHint.js';
285
+ import './components/OrLabelV3/OrLabel.js';
293
286
  import './index-500b3ace.js';
294
287
  import './components/OrButtonV2/OrButton.js';
295
288
  import './components/OrInput/OrInput.js';
@@ -301,6 +294,7 @@ import './OrDateTimePickerMonthSelect-8857f024.js';
301
294
  import './components/OrDateTimePickerV3/hooks/useDatePlaceholder.js';
302
295
  import './OrDateTimePickerPopoverHeader-ec90761f.js';
303
296
  import './components/OrDatePickerV3/styles.js';
297
+ import './components/OrInputBoxV3/OrInputBox.js';
304
298
  import './components/OrPopoverV3/OrPopover.js';
305
299
  import './toString-47fa81b4.js';
306
300
  import './isObject-3a5b854d.js';
@@ -324,6 +318,7 @@ import './components/OrInlineInputBoxV3/OrInlineInputBox.js';
324
318
  import './components/OrInlineTextareaV3/styles.js';
325
319
  import './components/OrLinkV3/styles.js';
326
320
  import './components/OrList/OrList.js';
321
+ import './components/OrModalV3/styles.js';
327
322
  import './components/OrNotificationV3/styles.js';
328
323
  import './components/OrPaginationV3/styles.js';
329
324
  import './round-136c7e43.js';
@@ -385,7 +380,6 @@ import './components/OrLoaderV3/styles.js';
385
380
  import './components/OrMenuItemV3/styles.js';
386
381
  import './components/OrMenuV3/styles.js';
387
382
  import './components/OrOverlay/OrOverlay.js';
388
- import './components/OrModalV3/styles.js';
389
383
  import './components/OrOverlayV3/styles.js';
390
384
  import './components/OrPopoverV3/styles.js';
391
385
  import './components/OrBottomSheetV3/OrBottomSheet.js';
@@ -1,4 +1,5 @@
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';
1
+ import { s as syntaxTree, E as EditorView, o as codePointSize, n as codePointAt, a as EditorSelection, q as CharCategory, P as Prec, Y as keymap, F as Facet, c as combineConfig, S as StateField, _ as showTooltip, $ as getTooltip, V as ViewPlugin, x as logException, j as StateEffect, a0 as MapMode, a1 as RangeValue, a2 as RangeSet, r as fromCodePoint, A as Annotation, d as Text, e as indentUnit, l as Decoration, D as Direction, W as WidgetType, a3 as Parser, a4 as NodeSet, a5 as NodeType, a6 as DefaultBufferLength, N as NodeProp, a7 as Tree, a8 as IterMode, a9 as styleTags, aa as tags$1, ab as parseMixed, ac as LanguageSupport, ad as LRLanguage, ae as indentNodeProp, af as continuedIndent, ag as foldNodeProp, ah as foldInside, ai as flatIndent, aj as delimitedIndent, ak as NodeWeakMap, al as Tag, am as Language, an as defineLanguageFacet, ao as languageDataProp, ap as LanguageDescription, aq as ParseContext } from './index-cf2c3c27.js';
2
+ import { OrCodeLanguages } from './components/OrCode/constants.js';
2
3
 
3
4
  /**
4
5
  An instance of this is passed to completion source functions.
@@ -7867,4 +7868,23 @@ function markdown() {
7867
7868
  return new LanguageSupport(mkLang(parser.configure(extensions)), support);
7868
7869
  }
7869
7870
 
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 };
7871
+ const JS = javascript({
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 };
@@ -15,7 +15,6 @@ 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';
19
18
  export * from './or-collapse';
20
19
  export * from './or-color-picker';
21
20
  export * from './or-combined-input-v3';
@@ -19,7 +19,6 @@ 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';
23
22
  export { _ as OrCollapse } from '../OrCollapse-9b5d590f.js';
24
23
  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';
25
24
  export { _ as OrCombinedInputV3 } from '../OrCombinedInput-ed20e33b.js';
@@ -143,7 +142,6 @@ import '@codemirror/lang-javascript';
143
142
  import '@codemirror/lang-markdown';
144
143
  import '@codemirror/language';
145
144
  import '@lezer/highlight';
146
- import '../useValidationAttributes-d1abbe34.js';
147
145
  import '../px-to-rem-0b26b83e.js';
148
146
  import '../dom-f1d55b67.js';
149
147
  import 'lodash/isElement';
@@ -155,6 +153,7 @@ import 'lodash/padStart';
155
153
  import '@floating-ui/dom';
156
154
  import '../OrTooltip.vue_rollup-plugin-vue_styles.0-47985d95.js';
157
155
  import 'lodash/isNil';
156
+ import '../useValidationAttributes-d1abbe34.js';
158
157
  import '../useResponsive-a02e95b7.js';
159
158
  import 'lodash/cloneDeep';
160
159
  import 'lodash/isEqual';
@@ -19,7 +19,6 @@ 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';
23
22
  export { _ as OrCollapse } from './OrCollapse-9b5d590f.js';
24
23
  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';
25
24
  export { _ as OrCombinedInputV3 } from './OrCombinedInput-ed20e33b.js';
@@ -15,7 +15,6 @@ 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';
19
18
  export * from './or-collapse';
20
19
  export * from './or-color-picker';
21
20
  export * from './or-combined-input-v3';
@@ -18,7 +18,6 @@ export { s as OrCheckboxV3 } from '../OrCheckbox-2194e473.js';
18
18
  export { s as OrChip } from '../OrChip-857982e0.js';
19
19
  export { s as OrChips } from '../OrChips-053f3a92.js';
20
20
  export { s as OrCode, O as OrCodeLanguages } from '../OrCode-2f8cdf96.js';
21
- export { C as CodeLanguage, s as OrCodeV3 } from '../OrCode-8ccd5dc7.js';
22
21
  export { s as OrCollapse } from '../OrCollapse-a06f22aa.js';
23
22
  export { s 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-475c0be4.js';
24
23
  export { s as OrCombinedInputV3 } from '../OrCombinedInput-e3891038.js';
@@ -138,7 +137,6 @@ import '@codemirror/lang-javascript';
138
137
  import '@codemirror/lang-markdown';
139
138
  import '@codemirror/language';
140
139
  import '@lezer/highlight';
141
- import '../useValidationAttributes-d1abbe34.js';
142
140
  import '../px-to-rem-0b26b83e.js';
143
141
  import '../dom-f1d55b67.js';
144
142
  import 'lodash/isElement';
@@ -148,6 +146,7 @@ import '../dropdown-open-e1f90e0a.js';
148
146
  import '../OrDateTimePickerPopoverHeader-bc8e0bcf.js';
149
147
  import 'lodash/padStart';
150
148
  import '@floating-ui/dom';
149
+ import '../useValidationAttributes-d1abbe34.js';
151
150
  import '../useResponsive-a02e95b7.js';
152
151
  import 'lodash/cloneDeep';
153
152
  import 'lodash/isEqual';
@@ -18,7 +18,6 @@ export { s as OrCheckboxV3 } from './OrCheckbox-2194e473.js';
18
18
  export { s as OrChip } from './OrChip-857982e0.js';
19
19
  export { s as OrChips } from './OrChips-053f3a92.js';
20
20
  export { s as OrCode, O as OrCodeLanguages } from './OrCode-2f8cdf96.js';
21
- export { C as CodeLanguage, s as OrCodeV3 } from './OrCode-8ccd5dc7.js';
22
21
  export { s as OrCollapse } from './OrCollapse-a06f22aa.js';
23
22
  export { s 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-475c0be4.js';
24
23
  export { s as OrCombinedInputV3 } from './OrCombinedInput-e3891038.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "4.10.1-beta.2921.0",
3
+ "version": "4.10.1",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -38,7 +38,7 @@
38
38
  "@codemirror/lang-json": "6.0.0",
39
39
  "@codemirror/lang-markdown": "6.0.1",
40
40
  "@floating-ui/dom": "0.3.1",
41
- "@onereach/styles": "^2.41.0",
41
+ "@onereach/styles": "^2.41.1",
42
42
  "@splidejs/splide": "4.0.6",
43
43
  "@types/lodash": "4.14.173",
44
44
  "@types/sortablejs": "1.10.7",
@@ -154,5 +154,6 @@
154
154
  "default": "./dist/bundled/v3/components/*/index.js"
155
155
  },
156
156
  "./package.json": "./package.json"
157
- }
157
+ },
158
+ "gitHead": "db3b85c7248794a590938b2c2f0e3cd3a6511234"
158
159
  }
@@ -15,7 +15,6 @@ 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';
19
18
  export * from './or-collapse';
20
19
  export * from './or-color-picker';
21
20
  export * from './or-combined-input-v3';
@@ -1,333 +0,0 @@
1
- import { b as basicSetup, i as indentWithTab } from '../../index-576b3dec.js';
2
- import { m as markdown, j as json, a as javascript, c as css, h as html } from '../../index-eba9b646.js';
3
- import { E as EditorView, k as keymap, a as EditorState } from '../../index-6a13fa4e.js';
4
- import { defineComponent, ref, computed, reactive, watch, onMounted, onUnmounted } from 'vue-demi';
5
- import { CodeLanguage } from './props.js';
6
- import { Code, CodeControl } from './styles.js';
7
- import __vue_component__$1 from '../OrErrorV3/OrError.js';
8
- import __vue_component__$2 from '../OrHintV3/OrHint.js';
9
- import __vue_component__$3 from '../OrIconButtonV3/OrIconButton.js';
10
- import __vue_component__$4 from '../OrInputBoxV3/OrInputBox.js';
11
- import __vue_component__$5 from '../OrLabelV3/OrLabel.js';
12
- import __vue_component__$6 from '../OrModalV3/OrModal.js';
13
- import { useIdAttribute } from '../../hooks/useIdAttribute.js';
14
- import { useControlAttributes } from '../../hooks/useControlAttributes.js';
15
- import { useValidationAttributes } from '../../hooks/useValidationAttributes.js';
16
- import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
17
- import '../OrErrorV3/styles.js';
18
- import '../OrHintV3/styles.js';
19
- import '../OrIconButtonV3/props.js';
20
- import '../OrIconV3/props.js';
21
- import '../OrIconButtonV3/styles.js';
22
- import '../OrIconV3/OrIcon.js';
23
- import '../OrIconV3/styles.js';
24
- import '../OrTooltipV3/OrTooltip.js';
25
- import '../OrTooltipV3/styles.js';
26
- import '../OrPopoverV3/OrPopover.js';
27
- import '../../floating-ui.dom.esm-83eba816.js';
28
- import '../../index-c92e2839.js';
29
- import '../../index-ec92055d.js';
30
- import '../OrPopoverV3/props.js';
31
- import '../OrPopoverV3/styles.js';
32
- import '../OrBottomSheetV3/OrBottomSheet.js';
33
- import '../OrBottomSheetV3/props.js';
34
- import '../OrBottomSheetV3/styles.js';
35
- import '../OrOverlayV3/OrOverlay.js';
36
- import '../OrOverlayV3/styles.js';
37
- import '../OrTeleportV3/OrTeleport.js';
38
- import 'vue';
39
- import '../../hooks/useElevation.js';
40
- import '../../utils/isVisible.js';
41
- import '../../hooks/usePopoverState.js';
42
- import '../../hooks/useResponsive/useResponsive.js';
43
- import '../OrInputBoxV3/props.js';
44
- import '../OrInputBoxV3/styles.js';
45
- import '../OrLabelV3/props.js';
46
- import '../OrLabelV3/styles.js';
47
- import '../OrModalV3/props.js';
48
- import '../OrModalV3/styles.js';
49
-
50
- var script = defineComponent({
51
- name: 'OrCode',
52
- components: {
53
- OrError: __vue_component__$1,
54
- OrHint: __vue_component__$2,
55
- OrIconButton: __vue_component__$3,
56
- OrInputBox: __vue_component__$4,
57
- OrLabel: __vue_component__$5,
58
- OrModal: __vue_component__$6
59
- },
60
- model: {
61
- prop: 'modelValue',
62
- event: 'update:modelValue'
63
- },
64
- props: {
65
- modelValue: {
66
- type: String,
67
- default: undefined
68
- },
69
- language: {
70
- type: String,
71
- default: CodeLanguage.JS
72
- },
73
- extensions: {
74
- type: Array,
75
- default: () => [basicSetup]
76
- },
77
- label: {
78
- type: String,
79
- default: undefined
80
- },
81
- hint: {
82
- type: String,
83
- default: undefined
84
- },
85
- error: {
86
- type: [String, Boolean],
87
- default: undefined
88
- },
89
- required: {
90
- type: Boolean,
91
- default: false
92
- },
93
- readonly: {
94
- type: Boolean,
95
- default: false
96
- },
97
- disabled: {
98
- type: Boolean,
99
- default: false
100
- }
101
- },
102
- emits: ['update:modelValue', 'keydown', 'keyup', 'focus', 'blur'],
103
- expose: ['root', 'focus', 'blur'],
104
- setup(props, context) {
105
- // Refs
106
- const root = ref();
107
- const control = ref();
108
- const fullscreenControl = ref();
109
- const modal = ref();
110
- // Styles
111
- const rootStyles = computed(() => ['or-code-v3', ...Code]);
112
- const controlStyles = computed(() => [...CodeControl]);
113
- // State
114
- const controlAttributes = reactive({
115
- id: useIdAttribute(),
116
- ...useControlAttributes(),
117
- ...useValidationAttributes()
118
- });
119
- const proxyModelValue = computed({
120
- get: () => props.modelValue,
121
- set: value => {
122
- context.emit('update:modelValue', value);
123
- }
124
- });
125
- const proxyLanguage = computed(() => {
126
- switch (props.language) {
127
- case CodeLanguage.HTML:
128
- return html();
129
- case CodeLanguage.CSS:
130
- return css();
131
- case CodeLanguage.JS:
132
- return javascript();
133
- case CodeLanguage.TS:
134
- return javascript({
135
- typescript: true
136
- });
137
- case CodeLanguage.JSON:
138
- return json();
139
- case CodeLanguage.MD:
140
- return markdown();
141
- }
142
- });
143
- // Methods
144
- function focus() {
145
- var _a;
146
- (_a = control.value) === null || _a === void 0 ? void 0 : _a.focus();
147
- }
148
- function blur() {
149
- var _a;
150
- (_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
151
- }
152
- // #region Codemirror
153
- const editorView = new EditorView({
154
- dispatch: transaction => {
155
- editorView.update([transaction]);
156
- proxyModelValue.value = String(editorView.state.doc);
157
- }
158
- });
159
- const extensions = computed(() => [...props.extensions, proxyLanguage.value, keymap.of([indentWithTab]), EditorView.editable.of(!props.readonly && !props.disabled), EditorView.domEventHandlers({
160
- keydown: event => {
161
- context.emit('keydown', event);
162
- },
163
- keyup: event => {
164
- context.emit('keyup', event);
165
- },
166
- focus: event => {
167
- context.emit('focus', event);
168
- },
169
- blur: event => {
170
- context.emit('blur', event);
171
- }
172
- }), EditorView.baseTheme({})]);
173
- watch([proxyModelValue, extensions], _ref => {
174
- let [modelValue = '', extensions] = _ref;
175
- const {
176
- selection
177
- } = editorView.state;
178
- editorView.setState(EditorState.create({
179
- doc: modelValue,
180
- extensions,
181
- selection: selection.ranges.some(range => range.to > modelValue.length) ? {
182
- anchor: modelValue.length
183
- } : selection
184
- }));
185
- }, {
186
- immediate: true
187
- });
188
- // #endregion
189
- // Effects
190
- watch(() => {
191
- var _a;
192
- return (_a = modal.value) === null || _a === void 0 ? void 0 : _a.state;
193
- }, value => {
194
- setTimeout(() => {
195
- var _a, _b;
196
- if (value === 'open') {
197
- (_a = fullscreenControl.value) === null || _a === void 0 ? void 0 : _a.append(editorView.dom);
198
- } else {
199
- (_b = control.value) === null || _b === void 0 ? void 0 : _b.append(editorView.dom);
200
- }
201
- });
202
- });
203
- // Lifecycle
204
- onMounted(() => {
205
- var _a;
206
- (_a = control.value) === null || _a === void 0 ? void 0 : _a.append(editorView.dom);
207
- });
208
- onUnmounted(() => {
209
- editorView.destroy();
210
- });
211
- return {
212
- root,
213
- control,
214
- fullscreenControl,
215
- modal,
216
- rootStyles,
217
- controlStyles,
218
- controlAttributes,
219
- proxyModelValue,
220
- proxyLanguage,
221
- focus,
222
- blur
223
- };
224
- }
225
- });
226
-
227
- /* script */
228
- const __vue_script__ = script;
229
-
230
- /* template */
231
- var __vue_render__ = function () {
232
- var _vm = this;
233
- var _h = _vm.$createElement;
234
- var _c = _vm._self._c || _h;
235
- return _c('div', {
236
- ref: "root",
237
- class: _vm.rootStyles
238
- }, [_vm.label ? [_c('OrLabel', {
239
- attrs: {
240
- "control-id": _vm.controlAttributes.id,
241
- "variant": 'input',
242
- "required": _vm.required,
243
- "disabled": _vm.disabled
244
- },
245
- scopedSlots: _vm._u([{
246
- key: "addon",
247
- fn: function () {
248
- return [_c('div', {
249
- class: ['layout-row', 'gap-xs']
250
- }, [_vm._t("addon"), _vm._v(" "), _c('OrIconButton', {
251
- attrs: {
252
- "icon": 'fullscreen'
253
- },
254
- on: {
255
- "click": function ($event) {
256
- $event.stopPropagation();
257
- return _vm.modal.open();
258
- }
259
- }
260
- })], 2)];
261
- },
262
- proxy: true
263
- }], null, true)
264
- }, [_vm._v("\n " + _vm._s(_vm.label) + "\n\n ")])] : _vm._e(), _vm._v(" "), _c('OrInputBox', {
265
- attrs: {
266
- "size": 'm',
267
- "invalid": !!_vm.error,
268
- "readonly": _vm.readonly,
269
- "disabled": _vm.disabled
270
- }
271
- }, [_c('div', {
272
- ref: "control",
273
- class: _vm.controlStyles
274
- })]), _vm._v(" "), _c('div', {
275
- directives: [{
276
- name: "show",
277
- rawName: "v-show",
278
- value: !_vm.error,
279
- expression: "!error"
280
- }],
281
- class: ['contents']
282
- }, [_vm.hint ? [_c('OrHint', {
283
- attrs: {
284
- "disabled": _vm.disabled
285
- }
286
- }, [_vm._v("\n " + _vm._s(_vm.hint) + "\n ")])] : _vm._e()], 2), _vm._v(" "), _c('div', {
287
- directives: [{
288
- name: "show",
289
- rawName: "v-show",
290
- value: typeof _vm.error === 'string',
291
- expression: "typeof error === 'string'"
292
- }],
293
- class: ['contents']
294
- }, [_c('OrError', {
295
- attrs: {
296
- "disabled": _vm.disabled
297
- }
298
- }, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")])], 1), _vm._v(" "), _c('OrModal', {
299
- ref: "modal"
300
- }, [_c('OrInputBox', {
301
- attrs: {
302
- "size": 'm',
303
- "invalid": !!_vm.error,
304
- "readonly": _vm.readonly,
305
- "disabled": _vm.disabled
306
- }
307
- }, [_c('div', {
308
- ref: "fullscreenControl",
309
- class: _vm.controlStyles
310
- })])], 1)], 2);
311
- };
312
- var __vue_staticRenderFns__ = [];
313
-
314
- /* style */
315
- const __vue_inject_styles__ = undefined;
316
- /* scoped */
317
- const __vue_scope_id__ = undefined;
318
- /* module identifier */
319
- const __vue_module_identifier__ = undefined;
320
- /* functional template */
321
- const __vue_is_functional_template__ = false;
322
- /* style inject */
323
-
324
- /* style inject SSR */
325
-
326
- /* style inject shadow dom */
327
-
328
- const __vue_component__ = /*#__PURE__*/normalizeComponent({
329
- render: __vue_render__,
330
- staticRenderFns: __vue_staticRenderFns__
331
- }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
332
-
333
- export { __vue_component__ as default };