@hywax/cms 0.0.22 → 1.0.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 (182) hide show
  1. package/.nuxt/cms/editor/index.ts +0 -2
  2. package/.nuxt/cms/form-panel-section.ts +2 -2
  3. package/.nuxt/cms/index.ts +8 -21
  4. package/.nuxt/cms/table-search-input.ts +6 -0
  5. package/dist/module.json +3 -3
  6. package/dist/module.mjs +78 -182
  7. package/dist/runtime/components/AutocompleteSelect.d.vue.ts +56 -0
  8. package/dist/runtime/components/AutocompleteSelect.vue +131 -77
  9. package/dist/runtime/components/AutocompleteSelect.vue.d.ts +43 -29
  10. package/dist/runtime/components/{ButtonDelete.vue.d.ts → ButtonDeleteConfirm.d.vue.ts} +4 -3
  11. package/dist/runtime/components/{ButtonDelete.vue → ButtonDeleteConfirm.vue} +1 -1
  12. package/dist/runtime/components/ButtonDeleteConfirm.vue.d.ts +36 -0
  13. package/dist/runtime/components/DatePicker.d.vue.ts +43 -0
  14. package/dist/runtime/components/DatePicker.vue +232 -0
  15. package/dist/runtime/components/DatePicker.vue.d.ts +43 -0
  16. package/dist/runtime/components/EditorFull.d.vue.ts +13 -0
  17. package/dist/runtime/components/EditorFull.vue +127 -0
  18. package/dist/runtime/components/EditorFull.vue.d.ts +13 -0
  19. package/dist/runtime/components/EditorLinkPopover.d.vue.ts +8 -0
  20. package/dist/runtime/components/EditorLinkPopover.vue +137 -0
  21. package/dist/runtime/components/EditorLinkPopover.vue.d.ts +8 -0
  22. package/dist/runtime/components/FormPanel.d.vue.ts +47 -0
  23. package/dist/runtime/components/FormPanel.vue +10 -7
  24. package/dist/runtime/components/FormPanel.vue.d.ts +21 -15
  25. package/dist/runtime/components/FormPanelAsideSection.d.vue.ts +24 -0
  26. package/dist/runtime/components/FormPanelAsideSection.vue.d.ts +2 -1
  27. package/dist/runtime/components/FormPanelSection.d.vue.ts +21 -0
  28. package/dist/runtime/components/FormPanelSection.vue +2 -2
  29. package/dist/runtime/components/FormPanelSection.vue.d.ts +3 -2
  30. package/dist/runtime/components/Layout.d.vue.ts +27 -0
  31. package/dist/runtime/components/Layout.vue +79 -0
  32. package/dist/runtime/components/Layout.vue.d.ts +27 -0
  33. package/dist/runtime/components/ModalConfirm.d.vue.ts +33 -0
  34. package/dist/runtime/components/ModalConfirm.vue.d.ts +3 -2
  35. package/dist/runtime/components/TableColumnSorting.d.vue.ts +17 -0
  36. package/dist/runtime/components/{TablePanelColumnSorting.vue → TableColumnSorting.vue} +27 -18
  37. package/dist/runtime/components/TableColumnSorting.vue.d.ts +17 -0
  38. package/dist/runtime/components/TableColumnVisibility.d.vue.ts +24 -0
  39. package/dist/runtime/components/TableColumnVisibility.vue +111 -0
  40. package/dist/runtime/components/TableColumnVisibility.vue.d.ts +24 -0
  41. package/dist/runtime/components/TableFilters.d.vue.ts +90 -0
  42. package/dist/runtime/components/TableFilters.vue +198 -0
  43. package/dist/runtime/components/TableFilters.vue.d.ts +90 -0
  44. package/dist/runtime/components/TablePanel.d.vue.ts +95 -0
  45. package/dist/runtime/components/TablePanel.vue +207 -66
  46. package/dist/runtime/components/TablePanel.vue.d.ts +76 -31
  47. package/dist/runtime/components/TableSearchInput.d.vue.ts +33 -0
  48. package/dist/runtime/components/TableSearchInput.vue +96 -0
  49. package/dist/runtime/components/TableSearchInput.vue.d.ts +33 -0
  50. package/dist/runtime/components/UploraImage.d.vue.ts +35 -0
  51. package/dist/runtime/components/UploraImage.vue.d.ts +3 -2
  52. package/dist/runtime/components/prose/UploraImage.d.vue.ts +14 -0
  53. package/dist/runtime/components/prose/UploraImage.vue.d.ts +2 -1
  54. package/dist/runtime/composables/useAdmin.d.ts +1 -1
  55. package/dist/runtime/composables/useAdmin.js +2 -1
  56. package/dist/runtime/composables/useApi.d.ts +1 -1
  57. package/dist/runtime/composables/useAsyncHandler.d.ts +1 -1
  58. package/dist/runtime/composables/useAsyncHandler.js +1 -1
  59. package/dist/runtime/composables/useEditorDragHandle.d.ts +16 -0
  60. package/dist/runtime/composables/useEditorDragHandle.js +95 -0
  61. package/dist/runtime/composables/useEditorSuggestions.d.ts +68 -0
  62. package/dist/runtime/composables/useEditorSuggestions.js +24 -0
  63. package/dist/runtime/composables/useEditorToolbar.d.ts +120 -0
  64. package/dist/runtime/composables/useEditorToolbar.js +87 -0
  65. package/dist/runtime/composables/useFormState.d.ts +12 -0
  66. package/dist/runtime/composables/useFormState.js +33 -0
  67. package/dist/runtime/composables/useLogout.d.ts +1 -1
  68. package/dist/runtime/composables/useLogout.js +3 -1
  69. package/dist/runtime/composables/useNotification.d.ts +12 -0
  70. package/dist/runtime/composables/useNotification.js +46 -0
  71. package/dist/runtime/composables/useQueryState.d.ts +28 -0
  72. package/dist/runtime/composables/useQueryState.js +105 -0
  73. package/dist/runtime/composables/useRouteQuery.d.ts +37 -0
  74. package/dist/runtime/composables/useRouteQuery.js +81 -0
  75. package/dist/runtime/composables/useRowSelection.d.ts +8 -0
  76. package/dist/runtime/composables/useRowSelection.js +46 -0
  77. package/dist/runtime/composables/useTable.d.ts +17 -11
  78. package/dist/runtime/composables/useTable.js +47 -53
  79. package/dist/runtime/composables/useUplora.d.ts +1 -1
  80. package/dist/runtime/composables/useUplora.js +2 -1
  81. package/dist/runtime/index.css +1 -1
  82. package/dist/runtime/plugins/zod.d.ts +2 -0
  83. package/dist/runtime/plugins/zod.js +26 -0
  84. package/dist/runtime/server/api/uplora/[id].delete.d.ts +1 -5
  85. package/dist/runtime/tv.d.ts +1 -1
  86. package/dist/runtime/types/date.d.ts +5 -0
  87. package/dist/runtime/types/index.d.ts +3 -21
  88. package/dist/runtime/types/index.js +1 -21
  89. package/dist/runtime/types/utils.d.ts +7 -0
  90. package/dist/runtime/utils/date.d.ts +9 -0
  91. package/dist/runtime/utils/date.js +28 -0
  92. package/dist/runtime/utils/formatters.d.ts +2 -0
  93. package/dist/runtime/utils/formatters.js +8 -0
  94. package/dist/runtime/utils/index.d.ts +5 -2
  95. package/dist/runtime/utils/index.js +5 -2
  96. package/dist/runtime/utils/storage.d.ts +2 -0
  97. package/dist/runtime/utils/storage.js +10 -0
  98. package/dist/runtime/utils/table.d.ts +23 -0
  99. package/dist/runtime/utils/table.js +51 -0
  100. package/package.json +26 -25
  101. package/.nuxt/cms/button-clear.ts +0 -5
  102. package/.nuxt/cms/button-copy.ts +0 -5
  103. package/.nuxt/cms/button-delete.ts +0 -5
  104. package/.nuxt/cms/editor/callout.ts +0 -21
  105. package/.nuxt/cms/editor/uplora-image.ts +0 -5
  106. package/.nuxt/cms/editor-content-full.ts +0 -6
  107. package/.nuxt/cms/editor-content-light.ts +0 -6
  108. package/.nuxt/cms/input-seo.ts +0 -5
  109. package/.nuxt/cms/input-slug.ts +0 -5
  110. package/.nuxt/cms/input-uplora-image.ts +0 -15
  111. package/.nuxt/cms/table-cell-preview.ts +0 -9
  112. package/.nuxt/cms/table-cell-seo.ts +0 -5
  113. package/.nuxt/cms/table-cell-user.ts +0 -9
  114. package/.nuxt/cms/table-panel-column-sorting.ts +0 -5
  115. package/.nuxt/cms/table-panel-column-visibility.ts +0 -5
  116. package/.nuxt/cms/table-panel-filters.ts +0 -5
  117. package/dist/runtime/components/ButtonClear.vue +0 -35
  118. package/dist/runtime/components/ButtonClear.vue.d.ts +0 -35
  119. package/dist/runtime/components/ButtonCopy.vue +0 -40
  120. package/dist/runtime/components/ButtonCopy.vue.d.ts +0 -23
  121. package/dist/runtime/components/EditorContentFull.vue +0 -53
  122. package/dist/runtime/components/EditorContentFull.vue.d.ts +0 -20
  123. package/dist/runtime/components/EditorContentLight.vue +0 -46
  124. package/dist/runtime/components/EditorContentLight.vue.d.ts +0 -20
  125. package/dist/runtime/components/InputSeo.vue +0 -73
  126. package/dist/runtime/components/InputSeo.vue.d.ts +0 -19
  127. package/dist/runtime/components/InputSlug.vue +0 -70
  128. package/dist/runtime/components/InputSlug.vue.d.ts +0 -29
  129. package/dist/runtime/components/InputUploraImage.vue +0 -136
  130. package/dist/runtime/components/InputUploraImage.vue.d.ts +0 -35
  131. package/dist/runtime/components/TableCellPreview.vue +0 -41
  132. package/dist/runtime/components/TableCellPreview.vue.d.ts +0 -18
  133. package/dist/runtime/components/TableCellSeo.vue +0 -34
  134. package/dist/runtime/components/TableCellSeo.vue.d.ts +0 -13
  135. package/dist/runtime/components/TableCellUser.vue +0 -40
  136. package/dist/runtime/components/TableCellUser.vue.d.ts +0 -18
  137. package/dist/runtime/components/TablePanelColumnSorting.vue.d.ts +0 -20
  138. package/dist/runtime/components/TablePanelColumnVisibility.vue +0 -49
  139. package/dist/runtime/components/TablePanelColumnVisibility.vue.d.ts +0 -20
  140. package/dist/runtime/components/TablePanelFilters.vue +0 -79
  141. package/dist/runtime/components/TablePanelFilters.vue.d.ts +0 -34
  142. package/dist/runtime/composables/useDeleteConfirm.d.ts +0 -15
  143. package/dist/runtime/composables/useDeleteConfirm.js +0 -27
  144. package/dist/runtime/composables/useSeoStats.d.ts +0 -12
  145. package/dist/runtime/composables/useSeoStats.js +0 -44
  146. package/dist/runtime/editor/components/BlockMenu.vue +0 -43
  147. package/dist/runtime/editor/components/BlockMenu.vue.d.ts +0 -2
  148. package/dist/runtime/editor/components/SlashCommand.vue +0 -92
  149. package/dist/runtime/editor/components/SlashCommand.vue.d.ts +0 -7
  150. package/dist/runtime/editor/components/TooltipLink.vue +0 -81
  151. package/dist/runtime/editor/components/TooltipLink.vue.d.ts +0 -9
  152. package/dist/runtime/editor/components/TooltipMenu.vue +0 -75
  153. package/dist/runtime/editor/components/TooltipMenu.vue.d.ts +0 -9
  154. package/dist/runtime/editor/extensions/callout/CalloutView.vue +0 -85
  155. package/dist/runtime/editor/extensions/callout/CalloutView.vue.d.ts +0 -7
  156. package/dist/runtime/editor/extensions/callout/extension.d.ts +0 -13
  157. package/dist/runtime/editor/extensions/callout/extension.js +0 -48
  158. package/dist/runtime/editor/extensions/callout/index.d.ts +0 -2
  159. package/dist/runtime/editor/extensions/callout/index.js +0 -2
  160. package/dist/runtime/editor/extensions/callout/types.d.ts +0 -3
  161. package/dist/runtime/editor/extensions/index.d.ts +0 -26
  162. package/dist/runtime/editor/extensions/index.js +0 -85
  163. package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue +0 -29
  164. package/dist/runtime/editor/extensions/uplora-image/UploraImageView.vue.d.ts +0 -7
  165. package/dist/runtime/editor/extensions/uplora-image/extension.d.ts +0 -13
  166. package/dist/runtime/editor/extensions/uplora-image/extension.js +0 -60
  167. package/dist/runtime/editor/extensions/uplora-image/index.d.ts +0 -2
  168. package/dist/runtime/editor/extensions/uplora-image/index.js +0 -2
  169. package/dist/runtime/editor/extensions/uplora-image/types.d.ts +0 -5
  170. package/dist/runtime/editor/extensions/uplora-image/types.js +0 -0
  171. package/dist/runtime/editor/markdown/index.d.ts +0 -3
  172. package/dist/runtime/editor/markdown/index.js +0 -47
  173. package/dist/runtime/editor/markdown/nodes/callout.d.ts +0 -2
  174. package/dist/runtime/editor/markdown/nodes/callout.js +0 -21
  175. package/dist/runtime/editor/markdown/nodes/uploraImage.d.ts +0 -2
  176. package/dist/runtime/editor/markdown/nodes/uploraImage.js +0 -31
  177. package/dist/runtime/utils/dictionaries.d.ts +0 -4
  178. package/dist/runtime/utils/dictionaries.js +0 -6
  179. /package/.nuxt/cms/{autocomplete-select.ts → button-delete-confirm.ts} +0 -0
  180. /package/dist/runtime/{editor/extensions/callout/types.js → types/date.js} +0 -0
  181. /package/dist/runtime/utils/{image.d.ts → uplora.d.ts} +0 -0
  182. /package/dist/runtime/utils/{image.js → uplora.js} +0 -0
@@ -1,85 +0,0 @@
1
- <template>
2
- <div :class="ui.root()">
3
- <div contenteditable="false" class="shrink-0">
4
- <UDropdownMenu :items="typeItems">
5
- <UButton
6
- :icon="iconTypeMap[type]"
7
- :color="iconColorMap[type]"
8
- size="xs"
9
- variant="soft"
10
- />
11
- </UDropdownMenu>
12
- </div>
13
-
14
- <div :ref="props.contentRef" />
15
- </div>
16
- </template>
17
-
18
- <script>
19
- import theme from "#build/cms/editor/callout";
20
- import { computed, ref, useAppConfig } from "#imports";
21
- import { tv } from "../../../tv";
22
- </script>
23
-
24
- <script setup>
25
- const props = defineProps({
26
- contentRef: { type: [String, Object, Function], required: true },
27
- view: { type: Object, required: true },
28
- getPos: { type: Function, required: true },
29
- setAttrs: { type: Function, required: true },
30
- node: { type: null, required: true },
31
- selected: { type: null, required: true },
32
- decorations: { type: null, required: true },
33
- innerDecorations: { type: null, required: true }
34
- });
35
- const appConfig = useAppConfig();
36
- const iconColorMap = {
37
- caution: "error",
38
- note: "info",
39
- warning: "warning",
40
- tip: "success"
41
- };
42
- const iconTypeMap = {
43
- caution: appConfig.ui.icons.caution,
44
- note: appConfig.ui.icons.info,
45
- warning: appConfig.ui.icons.warning,
46
- tip: appConfig.ui.icons.tip
47
- };
48
- const type = computed({
49
- get() {
50
- return props.node.value.attrs.type;
51
- },
52
- set(value) {
53
- props.setAttrs({ type: value });
54
- }
55
- });
56
- const typeItems = ref([
57
- {
58
- icon: iconTypeMap.caution,
59
- color: iconColorMap.caution,
60
- label: "\u041F\u0440\u0435\u0434\u0443\u043F\u0440\u0435\u0436\u0434\u0435\u043D\u0438\u0435",
61
- onSelect: () => type.value = "caution"
62
- },
63
- {
64
- icon: iconTypeMap.note,
65
- color: iconColorMap.note,
66
- label: "\u041F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u0435",
67
- onSelect: () => type.value = "note"
68
- },
69
- {
70
- icon: iconTypeMap.warning,
71
- color: iconColorMap.warning,
72
- label: "\u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435",
73
- onSelect: () => type.value = "warning"
74
- },
75
- {
76
- icon: iconTypeMap.tip,
77
- color: iconColorMap.tip,
78
- label: "\u0421\u043E\u0432\u0435\u0442",
79
- onSelect: () => type.value = "tip"
80
- }
81
- ]);
82
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.editor?.callout || {} })({
83
- type: type.value
84
- }));
85
- </script>
@@ -1,7 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { VueNodeViewProps } from 'prosekit/vue';
3
- import type { ComponentConfig } from '../../../types';
4
- import theme from '#build/cms/editor/callout';
5
- export type ProseCallout = ComponentConfig<typeof theme, AppConfig, 'callout', 'cms.editor'>;
6
- declare const _default: import("vue").DefineComponent<VueNodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VueNodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
- export default _default;
@@ -1,13 +0,0 @@
1
- import type { CalloutAttrs } from './types';
2
- export declare function defineCallout(): import("prosekit/core").Union<readonly [import("prosekit/core").Extension<{
3
- Nodes: {
4
- callout: CalloutAttrs;
5
- };
6
- }>, import("prosekit/core").Extension<import("prosekit/core").ExtensionTyping<any, any, any>>, import("prosekit/core").Extension<{
7
- Commands: {
8
- setCallout: [attrs?: CalloutAttrs | undefined];
9
- insertCallout: [attrs?: CalloutAttrs | undefined];
10
- toggleCallout: [attrs?: CalloutAttrs | undefined];
11
- setCalloutAttrs: [attrs: CalloutAttrs];
12
- };
13
- }>]>;
@@ -1,48 +0,0 @@
1
- import { defineCommands, defineNodeSpec, insertNode, setBlockType, setNodeAttrs, toggleWrap, union } from "prosekit/core";
2
- import { defineVueNodeView } from "prosekit/vue";
3
- import CalloutView from "./CalloutView.vue";
4
- function defineCalloutSpec() {
5
- return defineNodeSpec({
6
- name: "callout",
7
- group: "block",
8
- content: "block+",
9
- defining: true,
10
- draggable: true,
11
- attrs: {
12
- type: { default: "note" }
13
- },
14
- parseDOM: [{ tag: 'div[data-type="callout"]' }],
15
- toDOM({ attrs }) {
16
- return ["div", { "data-type": "callout", ...attrs }];
17
- }
18
- });
19
- }
20
- function defineCalloutView() {
21
- return defineVueNodeView({
22
- name: "callout",
23
- component: CalloutView
24
- });
25
- }
26
- function defineCalloutCommands() {
27
- return defineCommands({
28
- setCallout: (attrs) => {
29
- return setBlockType({ type: "callout", attrs });
30
- },
31
- insertCallout: (attrs) => {
32
- return insertNode({ type: "callout", attrs });
33
- },
34
- toggleCallout: (attrs) => {
35
- return toggleWrap({ type: "callout", attrs });
36
- },
37
- setCalloutAttrs: (attrs) => {
38
- return setNodeAttrs({ type: "callout", attrs });
39
- }
40
- });
41
- }
42
- export function defineCallout() {
43
- return union([
44
- defineCalloutSpec(),
45
- defineCalloutView(),
46
- defineCalloutCommands()
47
- ]);
48
- }
@@ -1,2 +0,0 @@
1
- export * from './extension';
2
- export * from './types';
@@ -1,2 +0,0 @@
1
- export * from "./extension.js";
2
- export * from "./types.js";
@@ -1,3 +0,0 @@
1
- export interface CalloutAttrs {
2
- type: 'caution' | 'note' | 'warning' | 'tip';
3
- }
@@ -1,26 +0,0 @@
1
- export type DefineFullExtension = ReturnType<typeof defineFullExtension>;
2
- export type DefineLightExtension = ReturnType<typeof defineLightExtension>;
3
- export declare function defineFullExtension(): import("prosekit/core").Union<readonly [import("prosekit/extensions/doc").DocExtension, import("prosekit/extensions/text").TextExtension, import("prosekit/extensions/paragraph").ParagraphExtension, import("prosekit/extensions/heading").HeadingExtension, import("prosekit/extensions/list").ListExtension, import("prosekit/extensions/blockquote").BlockquoteExtension, import("prosekit/extensions/image").ImageExtension, import("prosekit/extensions/horizontal-rule").HorizontalRuleExtension, import("prosekit/extensions/table").TableExtension, import("prosekit/extensions/code-block").CodeBlockExtension, import("prosekit/extensions/italic").ItalicExtension, import("prosekit/extensions/bold").BoldExtension, import("prosekit/extensions/underline").UnderlineExtension, import("prosekit/extensions/strike").StrikeExtension, import("prosekit/extensions/code").CodeExtension, import("prosekit/extensions/link").LinkExtension, import("prosekit/core").PlainExtension, import("prosekit/core").BaseCommandsExtension, import("prosekit/core").HistoryExtension, import("prosekit/core").PlainExtension, import("prosekit/core").PlainExtension, import("prosekit/core").PlainExtension, import("prosekit/core").PlainExtension, import("prosekit/core").PlainExtension, import("prosekit/core").Union<readonly [import("prosekit/core").Extension<{
4
- Nodes: {
5
- uploraImage: import("./uplora-image").UploraImageAttrs;
6
- };
7
- }>, import("prosekit/core").Extension<import("prosekit/core").ExtensionTyping<any, any, any>>, import("prosekit/core").Extension<{
8
- Commands: {
9
- setUploraImage: [attrs?: import("./uplora-image").UploraImageAttrs | undefined];
10
- insertUploraImage: [attrs?: import("./uplora-image").UploraImageAttrs | undefined];
11
- toggleUploraImage: [attrs?: import("./uplora-image").UploraImageAttrs | undefined];
12
- setUploraAttrs: [attrs: import("./uplora-image").UploraImageAttrs];
13
- };
14
- }>]>, import("prosekit/core").Union<readonly [import("prosekit/core").Extension<{
15
- Nodes: {
16
- callout: import("./callout").CalloutAttrs;
17
- };
18
- }>, import("prosekit/core").Extension<import("prosekit/core").ExtensionTyping<any, any, any>>, import("prosekit/core").Extension<{
19
- Commands: {
20
- setCallout: [attrs?: import("./callout").CalloutAttrs | undefined];
21
- insertCallout: [attrs?: import("./callout").CalloutAttrs | undefined];
22
- toggleCallout: [attrs?: import("./callout").CalloutAttrs | undefined];
23
- setCalloutAttrs: [attrs: import("./callout").CalloutAttrs];
24
- };
25
- }>]>]>;
26
- export declare function defineLightExtension(): import("prosekit/core").Union<readonly [import("prosekit/extensions/doc").DocExtension, import("prosekit/extensions/text").TextExtension, import("prosekit/extensions/paragraph").ParagraphExtension, import("prosekit/extensions/list").ListExtension, import("prosekit/extensions/blockquote").BlockquoteExtension, import("prosekit/extensions/code-block").CodeBlockExtension, import("prosekit/extensions/italic").ItalicExtension, import("prosekit/extensions/bold").BoldExtension, import("prosekit/extensions/underline").UnderlineExtension, import("prosekit/extensions/strike").StrikeExtension, import("prosekit/extensions/code").CodeExtension, import("prosekit/extensions/link").LinkExtension, import("prosekit/core").PlainExtension, import("prosekit/core").BaseCommandsExtension, import("prosekit/core").HistoryExtension, import("prosekit/core").PlainExtension, import("prosekit/core").PlainExtension]>;
@@ -1,85 +0,0 @@
1
- import { defineBaseCommands, defineBaseKeymap, defineHistory, union } from "prosekit/core";
2
- import { defineBlockquote } from "prosekit/extensions/blockquote";
3
- import { defineBold } from "prosekit/extensions/bold";
4
- import { defineCode } from "prosekit/extensions/code";
5
- import { defineCodeBlock } from "prosekit/extensions/code-block";
6
- import { defineDoc } from "prosekit/extensions/doc";
7
- import { defineDropCursor } from "prosekit/extensions/drop-cursor";
8
- import { defineGapCursor } from "prosekit/extensions/gap-cursor";
9
- import { defineHeading } from "prosekit/extensions/heading";
10
- import { defineHorizontalRule } from "prosekit/extensions/horizontal-rule";
11
- import { defineImage } from "prosekit/extensions/image";
12
- import { defineItalic } from "prosekit/extensions/italic";
13
- import { defineLink } from "prosekit/extensions/link";
14
- import { defineList } from "prosekit/extensions/list";
15
- import { defineModClickPrevention } from "prosekit/extensions/mod-click-prevention";
16
- import { defineParagraph } from "prosekit/extensions/paragraph";
17
- import { definePlaceholder } from "prosekit/extensions/placeholder";
18
- import { defineStrike } from "prosekit/extensions/strike";
19
- import { defineTable } from "prosekit/extensions/table";
20
- import { defineText } from "prosekit/extensions/text";
21
- import { defineUnderline } from "prosekit/extensions/underline";
22
- import { defineVirtualSelection } from "prosekit/extensions/virtual-selection";
23
- import { defineCallout } from "./callout/index.js";
24
- import { defineUploraImage } from "./uplora-image/index.js";
25
- export function defineFullExtension() {
26
- return union([
27
- // Nodes
28
- defineDoc(),
29
- defineText(),
30
- defineParagraph(),
31
- defineHeading(),
32
- defineList(),
33
- defineBlockquote(),
34
- defineImage(),
35
- defineHorizontalRule(),
36
- defineTable(),
37
- defineCodeBlock(),
38
- // Marks
39
- defineItalic(),
40
- defineBold(),
41
- defineUnderline(),
42
- defineStrike(),
43
- defineCode(),
44
- defineLink(),
45
- // Others
46
- defineBaseKeymap(),
47
- defineBaseCommands(),
48
- defineHistory(),
49
- defineDropCursor(),
50
- defineGapCursor(),
51
- defineVirtualSelection(),
52
- defineModClickPrevention(),
53
- definePlaceholder({
54
- placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 '/' \u0434\u043B\u044F \u043A\u043E\u043C\u0430\u043D\u0434"
55
- }),
56
- defineUploraImage(),
57
- defineCallout()
58
- ]);
59
- }
60
- export function defineLightExtension() {
61
- return union([
62
- // Nodes
63
- defineDoc(),
64
- defineText(),
65
- defineParagraph(),
66
- defineList(),
67
- defineBlockquote(),
68
- defineCodeBlock(),
69
- // Marks
70
- defineItalic(),
71
- defineBold(),
72
- defineUnderline(),
73
- defineStrike(),
74
- defineCode(),
75
- defineLink(),
76
- // Others
77
- defineBaseKeymap(),
78
- defineBaseCommands(),
79
- defineHistory(),
80
- defineModClickPrevention(),
81
- definePlaceholder({
82
- placeholder: "\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0435\u043A\u0441\u0442..."
83
- })
84
- ]);
85
- }
@@ -1,29 +0,0 @@
1
- <template>
2
- <InputUploraImage v-model="attrs" :class="ui.root()" />
3
- </template>
4
-
5
- <script>
6
- import theme from "#build/cms/editor/uplora-image";
7
- import { computed, useAppConfig } from "#imports";
8
- import InputUploraImage from "../../../components/InputUploraImage.vue";
9
- import { tv } from "../../../tv";
10
- </script>
11
-
12
- <script setup>
13
- const props = defineProps({
14
- contentRef: { type: [String, Object, Function], required: true },
15
- view: { type: Object, required: true },
16
- getPos: { type: Function, required: true },
17
- setAttrs: { type: Function, required: true },
18
- node: { type: null, required: true },
19
- selected: { type: null, required: true },
20
- decorations: { type: null, required: true },
21
- innerDecorations: { type: null, required: true }
22
- });
23
- const appConfig = useAppConfig();
24
- const attrs = computed({
25
- get: () => props.node.value.attrs,
26
- set: (value) => props.setAttrs(value)
27
- });
28
- const ui = computed(() => tv({ extend: tv(theme), ...appConfig.cms?.editor?.uploraImage || {} })());
29
- </script>
@@ -1,7 +0,0 @@
1
- import type { AppConfig } from '@nuxt/schema';
2
- import type { VueNodeViewProps } from 'prosekit/vue';
3
- import type { ComponentConfig } from '../../../types';
4
- import theme from '#build/cms/editor/uplora-image';
5
- export type ProseUploraImage = ComponentConfig<typeof theme, AppConfig, 'uploraImage', 'cms.editor'>;
6
- declare const _default: import("vue").DefineComponent<VueNodeViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VueNodeViewProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
- export default _default;
@@ -1,13 +0,0 @@
1
- import type { UploraImageAttrs } from './types';
2
- export declare function defineUploraImage(): import("prosekit/core").Union<readonly [import("prosekit/core").Extension<{
3
- Nodes: {
4
- uploraImage: UploraImageAttrs;
5
- };
6
- }>, import("prosekit/core").Extension<import("prosekit/core").ExtensionTyping<any, any, any>>, import("prosekit/core").Extension<{
7
- Commands: {
8
- setUploraImage: [attrs?: UploraImageAttrs | undefined];
9
- insertUploraImage: [attrs?: UploraImageAttrs | undefined];
10
- toggleUploraImage: [attrs?: UploraImageAttrs | undefined];
11
- setUploraAttrs: [attrs: UploraImageAttrs];
12
- };
13
- }>]>;
@@ -1,60 +0,0 @@
1
- import { Fragment, Slice } from "@prosekit/pm/model";
2
- import { defineCommands, defineNodeSpec, getNodeType, insertNode, setNodeAttrs, toggleWrap, union } from "prosekit/core";
3
- import { defineVueNodeView } from "prosekit/vue";
4
- import UploraImageView from "./UploraImageView.vue";
5
- function defineUploraImageSpec() {
6
- return defineNodeSpec({
7
- name: "uploraImage",
8
- group: "block",
9
- atom: true,
10
- attrs: {
11
- image: { default: "" },
12
- alt: { default: "" },
13
- lqip: { default: "" }
14
- },
15
- parseDOM: [{ tag: 'div[data-type="uplora-image"]' }],
16
- toDOM({ attrs }) {
17
- return ["div", { "data-type": "uplora-image", ...attrs }];
18
- }
19
- });
20
- }
21
- function defineUploraImageView() {
22
- return defineVueNodeView({
23
- name: "uploraImage",
24
- component: UploraImageView
25
- });
26
- }
27
- function defineUploraImageCommands() {
28
- return defineCommands({
29
- setUploraImage: (attrs) => {
30
- return (state, dispatch) => {
31
- if (!dispatch) {
32
- return true;
33
- }
34
- const { schema, tr } = state;
35
- const type = getNodeType(schema, "uploraImage");
36
- const node = type.create(attrs);
37
- const pos = tr.selection.anchor;
38
- tr.replaceRange(pos, pos, new Slice(Fragment.from(node), 0, 0));
39
- dispatch(tr);
40
- return true;
41
- };
42
- },
43
- insertUploraImage: (attrs) => {
44
- return insertNode({ type: "uploraImage", attrs });
45
- },
46
- toggleUploraImage: (attrs) => {
47
- return toggleWrap({ type: "uploraImage", attrs });
48
- },
49
- setUploraAttrs: (attrs) => {
50
- return setNodeAttrs({ type: "uploraImage", attrs });
51
- }
52
- });
53
- }
54
- export function defineUploraImage() {
55
- return union([
56
- defineUploraImageSpec(),
57
- defineUploraImageView(),
58
- defineUploraImageCommands()
59
- ]);
60
- }
@@ -1,2 +0,0 @@
1
- export * from './extension';
2
- export * from './types';
@@ -1,2 +0,0 @@
1
- export * from "./extension.js";
2
- export * from "./types.js";
@@ -1,5 +0,0 @@
1
- export interface UploraImageAttrs {
2
- image: string;
3
- alt: string;
4
- lqip?: string;
5
- }
@@ -1,3 +0,0 @@
1
- import type { MDCProsemirrorOptions } from '@unpress/mdc-prosemirror';
2
- export declare function docToMarkdown(doc: any, config?: MDCProsemirrorOptions): Promise<string>;
3
- export declare function markdownToDoc(markdown: string, config?: MDCProsemirrorOptions): Promise<import("@unpress/mdc-prosemirror").NodeJSON>;
@@ -1,47 +0,0 @@
1
- import { docToMarkdown as docToMarkdownProsemirror, markdownToDoc as markdownToDocProsemirror } from "@unpress/mdc-prosemirror";
2
- import { defu } from "defu";
3
- import { calloutNode } from "./nodes/callout.js";
4
- import { uploraImageNode } from "./nodes/uploraImage.js";
5
- function genericComponentNode(type) {
6
- const componentMap = {
7
- "callout": "callout",
8
- "caution": "callout",
9
- "note": "callout",
10
- "warning": "callout",
11
- "tip": "callout",
12
- "uplora-image": "uploraImage"
13
- };
14
- return {
15
- type,
16
- parse: () => {
17
- },
18
- compile: (node) => {
19
- if (!node || !node.attrs?.componentName) {
20
- return;
21
- }
22
- for (const [markdown, prosemirror] of Object.entries(componentMap)) {
23
- if (markdown === node.attrs.componentName) {
24
- node.type = prosemirror;
25
- return;
26
- }
27
- }
28
- }
29
- };
30
- }
31
- const extraNodes = [
32
- genericComponentNode("containerComponent"),
33
- genericComponentNode("textComponent"),
34
- genericComponentNode("leafComponent"),
35
- uploraImageNode,
36
- calloutNode
37
- ];
38
- export function docToMarkdown(doc, config) {
39
- return docToMarkdownProsemirror(doc, defu(config || {}, {
40
- extraNodes
41
- }));
42
- }
43
- export function markdownToDoc(markdown, config) {
44
- return markdownToDocProsemirror(markdown, defu(config || {}, {
45
- extraNodes
46
- }));
47
- }
@@ -1,2 +0,0 @@
1
- import type { ExtraNode } from '@unpress/mdc-prosemirror';
2
- export declare const calloutNode: ExtraNode;
@@ -1,21 +0,0 @@
1
- export const calloutNode = {
2
- type: "callout",
3
- parse: (node) => {
4
- if (!node) {
5
- return;
6
- }
7
- Object.assign(node, {
8
- type: "containerComponent",
9
- name: node.attrs?.type || "note"
10
- });
11
- },
12
- compile: (node) => {
13
- if (!node) {
14
- return;
15
- }
16
- node.type = "callout";
17
- node.attrs = {
18
- type: node.attrs?.componentName
19
- };
20
- }
21
- };
@@ -1,2 +0,0 @@
1
- import type { ExtraNode } from '@unpress/mdc-prosemirror';
2
- export declare const uploraImageNode: ExtraNode;
@@ -1,31 +0,0 @@
1
- export const uploraImageNode = {
2
- type: "uploraImage",
3
- parse: (node) => {
4
- if (!node) {
5
- return;
6
- }
7
- Object.assign(node, {
8
- type: "containerComponent",
9
- name: "uplora-image",
10
- attributes: {
11
- image: node.attrs?.image || "",
12
- alt: node.attrs?.alt || "",
13
- lqip: node.attrs?.lqip || ""
14
- },
15
- children: []
16
- });
17
- },
18
- compile: (node) => {
19
- if (!node) {
20
- return;
21
- }
22
- node.type = "uploraImage";
23
- node.attrs = {
24
- image: node.attrs?.attributes?.image || node.attrs?.fmAttributes?.image || "",
25
- alt: node.attrs?.attributes?.alt || node.attrs?.fmAttributes?.alt || "",
26
- color: node.attrs?.attributes?.color || node.attrs?.fmAttributes?.color || "",
27
- lqip: node.attrs?.attributes?.lqip || node.attrs?.fmAttributes?.lqip || ""
28
- };
29
- delete node.children;
30
- }
31
- };
@@ -1,4 +0,0 @@
1
- export declare function labelsToDictionary<T extends Record<any, string>>(labels: T): Array<{
2
- value: T[keyof T];
3
- label: string;
4
- }>;
@@ -1,6 +0,0 @@
1
- export function labelsToDictionary(labels) {
2
- return Object.entries(labels).map(([value, label]) => ({
3
- value,
4
- label
5
- }));
6
- }
File without changes
File without changes