@onereach/ui-components 4.1.0-beta.2508.0 → 4.1.0-beta.2510.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 +3 -4
- package/dist/bundled/v2/components/OrCode/index.js +3 -4
- package/dist/bundled/v2/components/OrCode/lang.js +2 -3
- package/dist/bundled/v2/components/OrCode/theme.js +1 -2
- package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +15 -19
- package/dist/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +2 -2
- package/dist/bundled/v2/components/OrRichTextEditorV3/index.js +4 -4
- package/dist/bundled/v2/components/OrRichTextEditorV3/styles.d.ts +0 -1
- package/dist/bundled/v2/components/OrRichTextEditorV3/styles.js +1 -4
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +4 -4
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +3 -2
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/index.js +2 -1
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/theme.d.ts +24 -0
- package/dist/bundled/v2/components/OrRichTextEditorV3/utils/codemirror/theme.js +190 -0
- package/dist/bundled/v2/components/index.js +4 -4
- package/dist/bundled/v2/{index-92e69736.js → index-16aee5bc.js} +2 -3
- package/dist/bundled/{v3/index-db5e8c99.js → v2/index-70ca38c5.js} +1 -2
- package/dist/bundled/{v3/index-c76372bb.js → v2/index-f5487f12.js} +4545 -14
- package/dist/bundled/v2/index.js +4 -4
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-0c5e41b0.js → OrCode.vue_vue_type_script_lang-f9e835d0.js} +2 -2
- package/dist/bundled/v3/{OrRichTextEditor.vue_vue_type_script_lang-33b56bd6.js → OrRichTextEditor.vue_vue_type_script_lang-35202f34.js} +6 -13
- package/dist/bundled/v3/components/OrCode/OrCode.js +5 -6
- package/dist/bundled/v3/components/OrCode/index.js +4 -5
- package/dist/bundled/v3/components/OrCode/lang.js +2 -3
- package/dist/bundled/v3/components/OrCode/theme.js +1 -2
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +13 -9
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.vue.d.ts +2 -2
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +5 -5
- package/dist/bundled/v3/components/OrRichTextEditorV3/styles.d.ts +0 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/styles.js +1 -4
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +4 -4
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +3 -2
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.js +2 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.d.ts +24 -0
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.js +190 -0
- package/dist/bundled/v3/components/index.js +6 -6
- package/dist/bundled/v3/{index-92e69736.js → index-16aee5bc.js} +2 -3
- package/dist/bundled/{v2/index-db5e8c99.js → v3/index-70ca38c5.js} +1 -2
- package/dist/bundled/{v2/index-c76372bb.js → v3/index-f5487f12.js} +4545 -14
- package/dist/bundled/v3/index.js +6 -6
- package/dist/esm/v2/{OrRichTextEditor-45fb1867.js → OrRichTextEditor-c0bf878d.js} +11 -18
- package/dist/esm/v2/{codemirrorView-2e87c938.js → codemirrorView-be2c7423.js} +170 -1
- package/dist/esm/v2/components/index.js +2 -2
- package/dist/esm/v2/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +2 -2
- package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +4 -2
- package/dist/esm/v2/components/or-rich-text-editor-v3/styles.d.ts +0 -1
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/index.js +3 -1
- package/dist/esm/v2/components/or-rich-text-editor-v3/utils/codemirror/theme.d.ts +24 -0
- package/dist/esm/v2/index.js +2 -2
- package/dist/esm/v3/{OrRichTextEditor-4c0b6030.js → OrRichTextEditor-06fe6154.js} +13 -19
- package/dist/esm/v3/{codemirrorView-2e87c938.js → codemirrorView-be2c7423.js} +170 -1
- package/dist/esm/v3/components/index.js +2 -2
- package/dist/esm/v3/components/or-rich-text-editor-v3/OrRichTextEditor.vue.d.ts +2 -2
- package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +4 -2
- package/dist/esm/v3/components/or-rich-text-editor-v3/styles.d.ts +0 -1
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/index.js +3 -1
- package/dist/esm/v3/components/or-rich-text-editor-v3/utils/codemirror/theme.d.ts +24 -0
- package/dist/esm/v3/index.js +2 -2
- package/package.json +2 -2
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +8 -17
- package/src/components/or-rich-text-editor-v3/styles.ts +0 -6
- package/src/components/or-rich-text-editor-v3/utils/codemirror/codemirrorView.ts +6 -4
- package/src/components/or-rich-text-editor-v3/utils/codemirror/theme.ts +213 -0
- package/dist/bundled/v2/index-62e39ec2.js +0 -4534
- package/dist/bundled/v3/index-62e39ec2.js +0 -4534
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EditorView, a as EditorState, k as keymap } from '../../index-
|
|
2
|
-
import { b as basicSetup, i as indentWithTab } from '../../index-
|
|
1
|
+
import { E as EditorView, a as EditorState, k as keymap } from '../../index-f5487f12.js';
|
|
2
|
+
import { b as basicSetup, i as indentWithTab } from '../../index-16aee5bc.js';
|
|
3
3
|
import { useElementHover } from '@vueuse/core';
|
|
4
4
|
import { defineComponent, ref } from 'vue-demi';
|
|
5
5
|
import __vue_component__$3 from '../OrTeleport/OrTeleport.js';
|
|
@@ -14,8 +14,7 @@ import __vue_component__$6 from '../OrLabel/OrLabel.js';
|
|
|
14
14
|
import { s as styleInject } from '../../style-inject.es-4c6f2515.js';
|
|
15
15
|
import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
|
|
16
16
|
import '../../index.es-3f39f316.js';
|
|
17
|
-
import '../../index-
|
|
18
|
-
import '../../index-db5e8c99.js';
|
|
17
|
+
import '../../index-70ca38c5.js';
|
|
19
18
|
import 'portal-vue/dist/portal-vue.esm.js';
|
|
20
19
|
import '../OrTeleport/constants.js';
|
|
21
20
|
import '../OrTooltip/OrTooltip.js';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export { default as OrCode } from './OrCode.js';
|
|
2
2
|
export { OrCodeLanguages } from './constants.js';
|
|
3
|
-
import '../../index-
|
|
3
|
+
import '../../index-f5487f12.js';
|
|
4
4
|
import '../../index.es-3f39f316.js';
|
|
5
|
-
import '../../index-
|
|
6
|
-
import '../../index-
|
|
7
|
-
import '../../index-db5e8c99.js';
|
|
5
|
+
import '../../index-16aee5bc.js';
|
|
6
|
+
import '../../index-70ca38c5.js';
|
|
8
7
|
import '@vueuse/core';
|
|
9
8
|
import 'vue-demi';
|
|
10
9
|
import '../OrTeleport/OrTeleport.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { C as ContextTracker, E as ExternalTokenizer, L as LRParser, j as javascriptLanguage, e as javascript } from '../../index-
|
|
2
|
-
import {
|
|
3
|
-
import { E as EditorView, b as EditorSelection, P as Prec, k as keymap } from '../../index-c76372bb.js';
|
|
1
|
+
import { C as ContextTracker, E as ExternalTokenizer, L as LRParser, j as javascriptLanguage, e as javascript } from '../../index-70ca38c5.js';
|
|
2
|
+
import { _ as styleTags, $ as tags$1, a0 as parseMixed, a1 as LanguageSupport, s as syntaxTree, a2 as LRLanguage, a3 as indentNodeProp, a4 as continuedIndent, a5 as foldNodeProp, a6 as foldInside, E as EditorView, b as EditorSelection, a7 as NodeType, N as NodeProp, a8 as NodeSet, a9 as Parser, aa as Tag, ab as Tree, P as Prec, k as keymap, ac as Language, ad as defineLanguageFacet, ae as languageDataProp, af as LanguageDescription, ag as ParseContext } from '../../index-f5487f12.js';
|
|
4
3
|
import { OrCodeLanguages } from './constants.js';
|
|
5
4
|
import '../../index.es-3f39f316.js';
|
|
6
5
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { E as EditorView } from '../../index-
|
|
2
|
-
import { H as HighlightStyle, t as tags, d as syntaxHighlighting } from '../../index-62e39ec2.js';
|
|
1
|
+
import { E as EditorView, ah as HighlightStyle, $ as tags, M as syntaxHighlighting } from '../../index-f5487f12.js';
|
|
3
2
|
import '../../index.es-3f39f316.js';
|
|
4
3
|
|
|
5
4
|
// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, ref, onMounted, onBeforeUnmount, computed, watch } from 'vue-demi';
|
|
2
2
|
import { onClickOutside } from '@vueuse/core';
|
|
3
3
|
import { B as Blockquote, a as Bold, b as BulletList, C as CodeBlock, H as HardBreak, I as Italic, L as ListItem, O as OrderedList, P as Paragraph, S as Strike, s as serialize, d as deserialize, c as Link, e as Highlight } from '../../markdown-00716a39.js';
|
|
4
|
-
import { EditorContainer, ToolbarContainer, Toolbar, ToolbarButtonFocused, ToolbarButton, EditorInput
|
|
4
|
+
import { EditorContainer, ToolbarContainer, Toolbar, ToolbarButtonFocused, ToolbarButton, EditorInput } from './styles.js';
|
|
5
5
|
import { M as Mark, m as mergeAttributes, a as markInputRule, b as markPasteRule, N as Node, E as Extension, k as keydownHandler, D as DecorationSet, c as Decoration, d as callOrReturn, g as getExtensionField, t as textblockTypeInputRule, n as nodeInputRule, e as Editor } from '../../tiptap-core.esm-f85402b1.js';
|
|
6
6
|
import { P as Plugin, d as dropPoint, S as Selection, N as NodeSelection, F as Fragment, a as Slice, T as TextSelection, b as PluginKey, M as Mapping } from '../../index-62c3221b.js';
|
|
7
7
|
import codemirrorNode from './utils/codemirror/codemirrorNode.js';
|
|
@@ -17,10 +17,10 @@ import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
|
|
|
17
17
|
import 'node:punycode';
|
|
18
18
|
import '../../index.es-3f39f316.js';
|
|
19
19
|
import './utils/codemirror/codemirrorView.js';
|
|
20
|
-
import '../../index-
|
|
21
|
-
import '
|
|
22
|
-
import '../../index-
|
|
23
|
-
import '../../index-
|
|
20
|
+
import '../../index-f5487f12.js';
|
|
21
|
+
import './utils/codemirror/theme.js';
|
|
22
|
+
import '../../index-16aee5bc.js';
|
|
23
|
+
import '../../index-70ca38c5.js';
|
|
24
24
|
import '../OrIconButtonV3/props.js';
|
|
25
25
|
import '../OrIconV3/props.js';
|
|
26
26
|
import '../OrIconButtonV3/styles.js';
|
|
@@ -1553,7 +1553,6 @@ var script = defineComponent({
|
|
|
1553
1553
|
const isActive = ref({});
|
|
1554
1554
|
const isFocused = ref(props.autofocus);
|
|
1555
1555
|
const headingLevels = [1, 2, 3, 4];
|
|
1556
|
-
const previousHeadingLevel = ref();
|
|
1557
1556
|
const activeHeadingLevel = ref(0);
|
|
1558
1557
|
const markdownOutput = ref('');
|
|
1559
1558
|
const isOpenLinkModal = ref(false);
|
|
@@ -1686,9 +1685,11 @@ var script = defineComponent({
|
|
|
1686
1685
|
});
|
|
1687
1686
|
//Methods
|
|
1688
1687
|
const handleEditorClick = () => {
|
|
1688
|
+
var _a;
|
|
1689
1689
|
setActiveFormats();
|
|
1690
1690
|
isFocused.value = true;
|
|
1691
1691
|
editor === null || editor === void 0 ? void 0 : editor.commands.focus();
|
|
1692
|
+
activeHeadingLevel.value = ((_a = editor === null || editor === void 0 ? void 0 : editor.getAttributes('heading')) === null || _a === void 0 ? void 0 : _a.level) || 0;
|
|
1692
1693
|
};
|
|
1693
1694
|
const handleToolbarClick = (item, level) => {
|
|
1694
1695
|
var _a, _b;
|
|
@@ -1727,12 +1728,11 @@ var script = defineComponent({
|
|
|
1727
1728
|
case 'heading':
|
|
1728
1729
|
if (!level) {
|
|
1729
1730
|
editor === null || editor === void 0 ? void 0 : editor.commands.toggleHeading({
|
|
1730
|
-
level:
|
|
1731
|
+
level: 0
|
|
1731
1732
|
});
|
|
1732
1733
|
activeHeadingLevel.value = 0;
|
|
1733
1734
|
} else {
|
|
1734
1735
|
activeHeadingLevel.value = level;
|
|
1735
|
-
previousHeadingLevel.value = level;
|
|
1736
1736
|
editor === null || editor === void 0 ? void 0 : editor.commands.toggleHeading({
|
|
1737
1737
|
level: level
|
|
1738
1738
|
});
|
|
@@ -1810,13 +1810,6 @@ var script = defineComponent({
|
|
|
1810
1810
|
const editorInputStyles = computed(() => {
|
|
1811
1811
|
return ['tiptap-editor', ...(props.fullHeight ? ['h-full'] : []), ...EditorInput];
|
|
1812
1812
|
});
|
|
1813
|
-
const toolbarButtonStyles = item => {
|
|
1814
|
-
return [
|
|
1815
|
-
// Layout
|
|
1816
|
-
'flex',
|
|
1817
|
-
// Spacing
|
|
1818
|
-
'gap-md', ...(isActive.value[item] ? ToolbarButtonActive : [])];
|
|
1819
|
-
};
|
|
1820
1813
|
//Effects
|
|
1821
1814
|
watch(proxyModelValue, value => {
|
|
1822
1815
|
if (value !== (editor === null || editor === void 0 ? void 0 : editor.getHTML()) && !props.markdownFormat) {
|
|
@@ -1843,7 +1836,6 @@ var script = defineComponent({
|
|
|
1843
1836
|
toolbarStyles,
|
|
1844
1837
|
rootStyles,
|
|
1845
1838
|
root,
|
|
1846
|
-
toolbarButtonStyles,
|
|
1847
1839
|
editorInputStyles,
|
|
1848
1840
|
getIndexOfHeading,
|
|
1849
1841
|
headingLevels,
|
|
@@ -1852,7 +1844,8 @@ var script = defineComponent({
|
|
|
1852
1844
|
discardLink,
|
|
1853
1845
|
isOpenLinkModal,
|
|
1854
1846
|
text,
|
|
1855
|
-
link
|
|
1847
|
+
link,
|
|
1848
|
+
isFocused
|
|
1856
1849
|
};
|
|
1857
1850
|
}
|
|
1858
1851
|
});
|
|
@@ -1887,12 +1880,13 @@ var __vue_render__ = function () {
|
|
|
1887
1880
|
}, _vm._l(tool, function (item) {
|
|
1888
1881
|
return _c('div', {
|
|
1889
1882
|
key: item,
|
|
1890
|
-
staticClass: "-my-xs"
|
|
1891
|
-
class: _vm.toolbarButtonStyles(item)
|
|
1883
|
+
staticClass: "-my-xs flex gap-md"
|
|
1892
1884
|
}, [item === 'heading' ? _c('or-icon-button', {
|
|
1893
1885
|
ref: "toolbarButtonRef",
|
|
1894
1886
|
refInFor: true,
|
|
1895
1887
|
attrs: {
|
|
1888
|
+
"selected": _vm.isActive[item],
|
|
1889
|
+
"disabled": !_vm.isFocused,
|
|
1896
1890
|
"tooltip": {
|
|
1897
1891
|
text: item,
|
|
1898
1892
|
placement: 'top'
|
|
@@ -1914,6 +1908,8 @@ var __vue_render__ = function () {
|
|
|
1914
1908
|
text: _vm.iconTooltipsEnum[item],
|
|
1915
1909
|
placement: 'top'
|
|
1916
1910
|
},
|
|
1911
|
+
"selected": _vm.isActive[item],
|
|
1912
|
+
"disabled": !_vm.isFocused,
|
|
1917
1913
|
"icon": {
|
|
1918
1914
|
icon: _vm.iconsEnum[item],
|
|
1919
1915
|
variant: 'inherit',
|
|
@@ -30,7 +30,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
30
30
|
toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
31
31
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
32
32
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
33
|
-
toolbarButtonStyles: (item: string) => string[];
|
|
34
33
|
editorInputStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
35
34
|
getIndexOfHeading: import("@vue/composition-api").ComputedRef<number>;
|
|
36
35
|
headingLevels: Level[];
|
|
@@ -40,6 +39,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
40
39
|
isOpenLinkModal: import("@vue/composition-api").Ref<boolean>;
|
|
41
40
|
text: import("@vue/composition-api").Ref<string>;
|
|
42
41
|
link: import("@vue/composition-api").Ref<string>;
|
|
42
|
+
isFocused: import("@vue/composition-api").Ref<boolean>;
|
|
43
43
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
44
44
|
modelValue: {
|
|
45
45
|
type: StringConstructor;
|
|
@@ -147,7 +147,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
147
147
|
toolbarStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
148
148
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
149
149
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
150
|
-
toolbarButtonStyles: (item: string) => string[];
|
|
151
150
|
editorInputStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
152
151
|
getIndexOfHeading: import("@vue/composition-api").ComputedRef<number>;
|
|
153
152
|
headingLevels: Level[];
|
|
@@ -157,6 +156,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
157
156
|
isOpenLinkModal: import("@vue/composition-api").Ref<boolean>;
|
|
158
157
|
text: import("@vue/composition-api").Ref<string>;
|
|
159
158
|
link: import("@vue/composition-api").Ref<string>;
|
|
159
|
+
isFocused: import("@vue/composition-api").Ref<boolean>;
|
|
160
160
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
161
161
|
modelValue: string;
|
|
162
162
|
value: string;
|
|
@@ -9,10 +9,10 @@ import '../../index.es-3f39f316.js';
|
|
|
9
9
|
import './styles.js';
|
|
10
10
|
import './utils/codemirror/codemirrorNode.js';
|
|
11
11
|
import './utils/codemirror/codemirrorView.js';
|
|
12
|
-
import '../../index-
|
|
13
|
-
import '
|
|
14
|
-
import '../../index-
|
|
15
|
-
import '../../index-
|
|
12
|
+
import '../../index-f5487f12.js';
|
|
13
|
+
import './utils/codemirror/theme.js';
|
|
14
|
+
import '../../index-16aee5bc.js';
|
|
15
|
+
import '../../index-70ca38c5.js';
|
|
16
16
|
import '../OrIconButtonV3/OrIconButton.js';
|
|
17
17
|
import '../OrIconButtonV3/props.js';
|
|
18
18
|
import '../OrIconV3/props.js';
|
|
@@ -3,5 +3,4 @@ export declare const ToolbarContainer: string[];
|
|
|
3
3
|
export declare const Toolbar: string[];
|
|
4
4
|
export declare const ToolbarButton: string[];
|
|
5
5
|
export declare const ToolbarButtonFocused: string[];
|
|
6
|
-
export declare const ToolbarButtonActive: string[];
|
|
7
6
|
export declare const EditorInput: string[];
|
|
@@ -29,9 +29,6 @@ const ToolbarButton = [
|
|
|
29
29
|
const ToolbarButtonFocused = [
|
|
30
30
|
// Typography
|
|
31
31
|
'text-outline', 'dark:text-outline-dark'];
|
|
32
|
-
const ToolbarButtonActive = [
|
|
33
|
-
// Typography
|
|
34
|
-
'text-on-background', 'dark:text-on-background-dark'];
|
|
35
32
|
const EditorInput = [
|
|
36
33
|
// Spacing
|
|
37
34
|
'p-sm',
|
|
@@ -40,4 +37,4 @@ const EditorInput = [
|
|
|
40
37
|
// Sizing
|
|
41
38
|
'min-h-[88px]'];
|
|
42
39
|
|
|
43
|
-
export { EditorContainer, EditorInput, Toolbar, ToolbarButton,
|
|
40
|
+
export { EditorContainer, EditorInput, Toolbar, ToolbarButton, ToolbarButtonFocused, ToolbarContainer };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { N as Node } from '../../../../tiptap-core.esm-f85402b1.js';
|
|
2
2
|
import CodeMirrorView from './codemirrorView.js';
|
|
3
|
-
import { m as minimalSetup } from '../../../../index-
|
|
4
|
-
import { e as javascript } from '../../../../index-
|
|
3
|
+
import { m as minimalSetup } from '../../../../index-16aee5bc.js';
|
|
4
|
+
import { e as javascript } from '../../../../index-70ca38c5.js';
|
|
5
5
|
import '../../../../index-62c3221b.js';
|
|
6
6
|
import '../../../../index.es-3f39f316.js';
|
|
7
|
-
import '../../../../index-
|
|
8
|
-
import '
|
|
7
|
+
import '../../../../index-f5487f12.js';
|
|
8
|
+
import './theme.js';
|
|
9
9
|
|
|
10
10
|
var codemirrorNode = Node.create({
|
|
11
11
|
name: 'codeBlock',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { n as exitCode, T as TextSelection, S as Selection } from '../../../../index-62c3221b.js';
|
|
2
|
-
import { a as EditorState, E as EditorView,
|
|
2
|
+
import { a as EditorState, E as EditorView, Y as highlightActiveLine, B as highlightActiveLineGutter, z as lineNumbers, k as keymap } from '../../../../index-f5487f12.js';
|
|
3
|
+
import theme from './theme.js';
|
|
3
4
|
import '../../../../index.es-3f39f316.js';
|
|
4
5
|
|
|
5
6
|
const computeChange = (oldVal, newVal) => {
|
|
@@ -45,7 +46,7 @@ class CodeMirrorView {
|
|
|
45
46
|
this.dom = this.cm.dom;
|
|
46
47
|
const cmState = EditorState.create({
|
|
47
48
|
doc: this.node.textContent,
|
|
48
|
-
extensions: [changeFilter, highlightActiveLine(), highlightActiveLineGutter(), lineNumbers(), keymap.of([{
|
|
49
|
+
extensions: [theme, changeFilter, highlightActiveLine(), highlightActiveLineGutter(), lineNumbers(), keymap.of([{
|
|
49
50
|
key: 'ArrowUp',
|
|
50
51
|
run: this.mayBeEscape('line', -1)
|
|
51
52
|
}, {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Extension } from '@codemirror/state';
|
|
2
|
+
import { HighlightStyle } from '@codemirror/language';
|
|
3
|
+
export declare const color: {
|
|
4
|
+
chalky: string;
|
|
5
|
+
coral: string;
|
|
6
|
+
cyan: string;
|
|
7
|
+
invalid: string;
|
|
8
|
+
ivory: string;
|
|
9
|
+
stone: string;
|
|
10
|
+
malibu: string;
|
|
11
|
+
sage: string;
|
|
12
|
+
whiskey: string;
|
|
13
|
+
violet: string;
|
|
14
|
+
darkBackground: string;
|
|
15
|
+
highlightBackground: string;
|
|
16
|
+
background: string;
|
|
17
|
+
tooltipBackground: string;
|
|
18
|
+
selection: string;
|
|
19
|
+
cursor: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const orCodeTheme: Extension;
|
|
22
|
+
export declare const orCodeHighlightStyle: HighlightStyle;
|
|
23
|
+
declare const theme: Extension;
|
|
24
|
+
export default theme;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { E as EditorView, ah as HighlightStyle, $ as tags, M as syntaxHighlighting } from '../../../../index-f5487f12.js';
|
|
2
|
+
import '../../../../index.es-3f39f316.js';
|
|
3
|
+
|
|
4
|
+
// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors
|
|
5
|
+
const chalky = 'var(--c-warning-darken-20)',
|
|
6
|
+
coral = 'var(--c-error)',
|
|
7
|
+
cyan = '#56b6c2',
|
|
8
|
+
invalid = 'var(--c-white)',
|
|
9
|
+
ivory = 'var(--c-neutral-6)',
|
|
10
|
+
stone = 'var(--c-neutral-5)',
|
|
11
|
+
// Brightened compared to original to increase contrast
|
|
12
|
+
malibu = '#61afef',
|
|
13
|
+
sage = 'var(--c-success)',
|
|
14
|
+
whiskey = 'var(--c-warning-darken-5)',
|
|
15
|
+
violet = '#c678dd',
|
|
16
|
+
darkBackground = 'var(--c-neutral-1)',
|
|
17
|
+
highlightBackground = 'var(--c-neutral-2)',
|
|
18
|
+
background = 'var(--c-neutral-1)',
|
|
19
|
+
tooltipBackground = 'var(--c-neutral-2)',
|
|
20
|
+
selection = 'var(--c-neutral-3)',
|
|
21
|
+
cursor = 'var(--c-primary)';
|
|
22
|
+
/// The colors used in the theme, as CSS color strings.
|
|
23
|
+
const color = {
|
|
24
|
+
chalky,
|
|
25
|
+
coral,
|
|
26
|
+
cyan,
|
|
27
|
+
invalid,
|
|
28
|
+
ivory,
|
|
29
|
+
stone,
|
|
30
|
+
malibu,
|
|
31
|
+
sage,
|
|
32
|
+
whiskey,
|
|
33
|
+
violet,
|
|
34
|
+
darkBackground,
|
|
35
|
+
highlightBackground,
|
|
36
|
+
background,
|
|
37
|
+
tooltipBackground,
|
|
38
|
+
selection,
|
|
39
|
+
cursor
|
|
40
|
+
};
|
|
41
|
+
/// The editor theme styles for One Dark.
|
|
42
|
+
const orCodeTheme = EditorView.theme({
|
|
43
|
+
'&': {
|
|
44
|
+
color: ivory,
|
|
45
|
+
backgroundColor: background
|
|
46
|
+
},
|
|
47
|
+
'.cm-content': {
|
|
48
|
+
caretColor: cursor
|
|
49
|
+
},
|
|
50
|
+
'.cm-button': {
|
|
51
|
+
background: highlightBackground,
|
|
52
|
+
color: 'var(--c-neutral-6)',
|
|
53
|
+
border: 0,
|
|
54
|
+
borderRadius: 'var(--s-2)'
|
|
55
|
+
},
|
|
56
|
+
'.cm-panel.cm-search input[type=checkbox]': {
|
|
57
|
+
display: 'inline-block',
|
|
58
|
+
verticalAlign: 'middle'
|
|
59
|
+
},
|
|
60
|
+
'.cm-cursor, .cm-dropCursor': {
|
|
61
|
+
borderLeftColor: cursor
|
|
62
|
+
},
|
|
63
|
+
'&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': {
|
|
64
|
+
backgroundColor: selection
|
|
65
|
+
},
|
|
66
|
+
'.cm-panels': {
|
|
67
|
+
backgroundColor: darkBackground,
|
|
68
|
+
color: ivory
|
|
69
|
+
},
|
|
70
|
+
'.cm-panels.cm-panels-top': {
|
|
71
|
+
borderBottom: '2px solid var(--c-neutral-2)'
|
|
72
|
+
},
|
|
73
|
+
'.cm-panels.cm-panels-bottom': {
|
|
74
|
+
borderTop: '2px solid var(--c-neutral-2)'
|
|
75
|
+
},
|
|
76
|
+
'.cm-searchMatch': {
|
|
77
|
+
backgroundColor: 'var(--c-neutral-1)',
|
|
78
|
+
outline: '1px solid var(--c-neutral-2)'
|
|
79
|
+
},
|
|
80
|
+
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
81
|
+
backgroundColor: '#6199ff2f'
|
|
82
|
+
},
|
|
83
|
+
'.cm-activeLine': {
|
|
84
|
+
backgroundColor: '#6699ff0b'
|
|
85
|
+
},
|
|
86
|
+
'.cm-selectionMatch': {
|
|
87
|
+
backgroundColor: '#aafe661a'
|
|
88
|
+
},
|
|
89
|
+
'&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
|
|
90
|
+
backgroundColor: '#bad0f847'
|
|
91
|
+
},
|
|
92
|
+
'.cm-gutters': {
|
|
93
|
+
backgroundColor: background,
|
|
94
|
+
color: stone,
|
|
95
|
+
border: 'none'
|
|
96
|
+
},
|
|
97
|
+
'.cm-activeLineGutter': {
|
|
98
|
+
backgroundColor: highlightBackground
|
|
99
|
+
},
|
|
100
|
+
'.cm-foldPlaceholder': {
|
|
101
|
+
backgroundColor: 'transparent',
|
|
102
|
+
border: 'none',
|
|
103
|
+
color: '#ddd'
|
|
104
|
+
},
|
|
105
|
+
'.cm-tooltip': {
|
|
106
|
+
border: 'none',
|
|
107
|
+
backgroundColor: tooltipBackground
|
|
108
|
+
},
|
|
109
|
+
'.cm-tooltip .cm-tooltip-arrow:before': {
|
|
110
|
+
borderTopColor: 'transparent',
|
|
111
|
+
borderBottomColor: 'transparent'
|
|
112
|
+
},
|
|
113
|
+
'.cm-tooltip .cm-tooltip-arrow:after': {
|
|
114
|
+
borderTopColor: tooltipBackground,
|
|
115
|
+
borderBottomColor: tooltipBackground
|
|
116
|
+
},
|
|
117
|
+
'.cm-tooltip-autocomplete': {
|
|
118
|
+
'& > ul > li[aria-selected]': {
|
|
119
|
+
backgroundColor: highlightBackground,
|
|
120
|
+
color: ivory
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
'.cm-textfield': {
|
|
124
|
+
outline: 'none',
|
|
125
|
+
background: background,
|
|
126
|
+
color: 'var(--c-neutral-6)',
|
|
127
|
+
backgroundColor: 'var(--c-neutral-1)',
|
|
128
|
+
border: '1px solid var(--c-neutral-2)',
|
|
129
|
+
borderRadius: 'var(--s-2)'
|
|
130
|
+
}
|
|
131
|
+
}, {
|
|
132
|
+
dark: true
|
|
133
|
+
});
|
|
134
|
+
/// The highlighting style for code in the One Dark theme.
|
|
135
|
+
const orCodeHighlightStyle = HighlightStyle.define([{
|
|
136
|
+
tag: tags.keyword,
|
|
137
|
+
color: violet
|
|
138
|
+
}, {
|
|
139
|
+
tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName],
|
|
140
|
+
color: coral
|
|
141
|
+
}, {
|
|
142
|
+
tag: [tags.function(tags.variableName), tags.labelName],
|
|
143
|
+
color: malibu
|
|
144
|
+
}, {
|
|
145
|
+
tag: [tags.color, tags.constant(tags.name), tags.standard(tags.name)],
|
|
146
|
+
color: whiskey
|
|
147
|
+
}, {
|
|
148
|
+
tag: [tags.definition(tags.name), tags.separator],
|
|
149
|
+
color: ivory
|
|
150
|
+
}, {
|
|
151
|
+
tag: [tags.typeName, tags.className, tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace],
|
|
152
|
+
color: chalky
|
|
153
|
+
}, {
|
|
154
|
+
tag: [tags.operator, tags.operatorKeyword, tags.url, tags.escape, tags.regexp, tags.link, tags.special(tags.string)],
|
|
155
|
+
color: cyan
|
|
156
|
+
}, {
|
|
157
|
+
tag: [tags.meta, tags.comment],
|
|
158
|
+
color: stone
|
|
159
|
+
}, {
|
|
160
|
+
tag: tags.strong,
|
|
161
|
+
fontWeight: 'bold'
|
|
162
|
+
}, {
|
|
163
|
+
tag: tags.emphasis,
|
|
164
|
+
fontStyle: 'italic'
|
|
165
|
+
}, {
|
|
166
|
+
tag: tags.strikethrough,
|
|
167
|
+
textDecoration: 'line-through'
|
|
168
|
+
}, {
|
|
169
|
+
tag: tags.link,
|
|
170
|
+
color: stone,
|
|
171
|
+
textDecoration: 'underline'
|
|
172
|
+
}, {
|
|
173
|
+
tag: tags.heading,
|
|
174
|
+
fontWeight: 'bold',
|
|
175
|
+
color: coral
|
|
176
|
+
}, {
|
|
177
|
+
tag: [tags.atom, tags.bool, tags.special(tags.variableName)],
|
|
178
|
+
color: whiskey
|
|
179
|
+
}, {
|
|
180
|
+
tag: [tags.processingInstruction, tags.string, tags.inserted],
|
|
181
|
+
color: sage
|
|
182
|
+
}, {
|
|
183
|
+
tag: tags.invalid,
|
|
184
|
+
color: invalid
|
|
185
|
+
}]);
|
|
186
|
+
/// Extension to enable the One Dark theme (both the editor theme and
|
|
187
|
+
/// the highlight style).
|
|
188
|
+
const theme = [orCodeTheme, syntaxHighlighting(orCodeHighlightStyle)];
|
|
189
|
+
|
|
190
|
+
export { color, theme as default, orCodeHighlightStyle, orCodeTheme };
|
|
@@ -194,11 +194,10 @@ import './OrCardV3/styles.js';
|
|
|
194
194
|
import './OrCarousel/constants.js';
|
|
195
195
|
import './OrCheckboxV3/styles.js';
|
|
196
196
|
import './OrChips/constants.js';
|
|
197
|
-
import '../index-
|
|
197
|
+
import '../index-f5487f12.js';
|
|
198
198
|
import '../index.es-3f39f316.js';
|
|
199
|
-
import '../index-
|
|
200
|
-
import '../index-
|
|
201
|
-
import '../index-db5e8c99.js';
|
|
199
|
+
import '../index-16aee5bc.js';
|
|
200
|
+
import '../index-70ca38c5.js';
|
|
202
201
|
import './OrCode/lang.js';
|
|
203
202
|
import './OrCode/theme.js';
|
|
204
203
|
import './OrColorPicker/utils/defultPalette.js';
|
|
@@ -246,3 +245,4 @@ import '../tiptap-core.esm-f85402b1.js';
|
|
|
246
245
|
import './OrRichTextEditorV3/styles.js';
|
|
247
246
|
import './OrRichTextEditorV3/utils/codemirror/codemirrorNode.js';
|
|
248
247
|
import './OrRichTextEditorV3/utils/codemirror/codemirrorView.js';
|
|
248
|
+
import './OrRichTextEditorV3/utils/codemirror/theme.js';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { E as EditorView, F as Facet, c as combineConfig, S as StateField, b as EditorSelection, T as Transaction, C as ChangeSet, d as ChangeDesc, e as Text, f as countColumn, A as Annotation,
|
|
2
|
-
import {
|
|
3
|
-
import { c as closeBrackets, a as autocompletion, b as closeBracketsKeymap, d as completionKeymap } from './index-db5e8c99.js';
|
|
1
|
+
import { E as EditorView, F as Facet, c as combineConfig, S as StateField, b as EditorSelection, T as Transaction, C as ChangeSet, d as ChangeDesc, I as IndentContext, g as getIndentation, i as indentString, e as Text, f as indentUnit, h as countColumn, j as getIndentUnit, A as Annotation, l as StateEffect, m as matchBrackets, s as syntaxTree, N as NodeProp, D as Direction, n as findClusterBreak, V as ViewPlugin, o as Decoration, p as codePointAt, q as codePointSize, r as getPanel, t as CharCategory, P as Prec, u as fromCodePoint, v as showPanel, R as RangeSetBuilder, a as EditorState, w as runScopeHandlers, x as hoverTooltip, W as WidgetType, y as logException, z as lineNumbers, B as highlightActiveLineGutter, G as highlightSpecialChars, H as foldGutter, J as drawSelection, K as dropCursor, L as indentOnInput, M as syntaxHighlighting, O as defaultHighlightStyle, Q as bracketMatching, U as rectangularSelection, X as crosshairCursor, Y as highlightActiveLine, k as keymap, Z as foldKeymap } from './index-f5487f12.js';
|
|
2
|
+
import { c as closeBrackets, a as autocompletion, b as closeBracketsKeymap, d as completionKeymap } from './index-70ca38c5.js';
|
|
4
3
|
|
|
5
4
|
/**
|
|
6
5
|
Comment or uncomment the current selection. Will use line comments
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { s as syntaxTree,
|
|
2
|
-
import { E as EditorView, l as codePointSize, j as codePointAt, b as EditorSelection, n as CharCategory, P as Prec, k as keymap, F as Facet, c as combineConfig, S as StateField, K as showTooltip, L as getTooltip, V as ViewPlugin, q as logException, g as StateEffect, M as MapMode, N as RangeValue, H as RangeSet, o as fromCodePoint, A as Annotation, e as Text, i as Decoration, D as Direction, W as WidgetType } from './index-c76372bb.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, ai as showTooltip, aj as getTooltip, V as ViewPlugin, y as logException, l as StateEffect, ak as MapMode, al as RangeValue, am as RangeSet, u as fromCodePoint, A as Annotation, e as Text, f as indentUnit, o as Decoration, D as Direction, W as WidgetType, a9 as Parser, a8 as NodeSet, a7 as NodeType, an as DefaultBufferLength, N as NodeProp, ab as Tree, ao as IterMode, _ as styleTags, $ as tags, a1 as LanguageSupport, a2 as LRLanguage, a3 as indentNodeProp, a4 as continuedIndent, ap as flatIndent, aq as delimitedIndent, a5 as foldNodeProp, a6 as foldInside, ar as NodeWeakMap } from './index-f5487f12.js';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
An instance of this is passed to completion source functions.
|