@lupinum/ginko-editor 0.1.0 → 0.18.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.
Files changed (166) hide show
  1. package/CHANGELOG.md +7 -73
  2. package/LICENSE +1 -1
  3. package/README.md +15 -340
  4. package/dist/assets.d.ts +70 -0
  5. package/dist/assets.js +31 -0
  6. package/dist/core/component-props.d.ts +87 -0
  7. package/dist/core/component-props.js +134 -0
  8. package/dist/core/convert.d.ts +24 -0
  9. package/dist/core/convert.js +278 -0
  10. package/dist/core/editor.d.ts +60 -0
  11. package/dist/core/editor.js +85 -0
  12. package/dist/core/extensions.d.ts +38 -0
  13. package/dist/core/extensions.js +444 -0
  14. package/dist/core/file-images.d.ts +9 -0
  15. package/dist/core/file-images.js +54 -0
  16. package/dist/core/image-frame.d.ts +23 -0
  17. package/dist/core/image-frame.js +24 -0
  18. package/dist/core/index.d.ts +17 -0
  19. package/dist/core/index.js +17 -0
  20. package/dist/core/link-card.d.ts +20 -0
  21. package/dist/core/link-card.js +70 -0
  22. package/dist/core/link.d.ts +3 -0
  23. package/dist/core/link.js +8 -0
  24. package/dist/core/move.d.ts +11 -0
  25. package/dist/core/move.js +37 -0
  26. package/dist/core/paste-html.d.ts +6 -0
  27. package/dist/core/paste-html.js +384 -0
  28. package/dist/core/paste.d.ts +21 -0
  29. package/dist/core/paste.js +108 -0
  30. package/dist/core/problems.d.ts +31 -0
  31. package/dist/core/problems.js +54 -0
  32. package/dist/core/search.d.ts +47 -0
  33. package/dist/core/search.js +148 -0
  34. package/dist/core/slash.d.ts +93 -0
  35. package/dist/core/slash.js +215 -0
  36. package/dist/core/table.d.ts +34 -0
  37. package/dist/core/table.js +141 -0
  38. package/dist/core/uploads.d.ts +23 -0
  39. package/dist/core/uploads.js +71 -0
  40. package/dist/core/use-editor.d.ts +19 -0
  41. package/dist/core/use-editor.js +53 -0
  42. package/dist/index.d.ts +6 -15
  43. package/dist/index.js +6 -5668
  44. package/dist/issues.d.ts +49 -0
  45. package/dist/issues.js +9 -0
  46. package/dist/today.d.ts +6 -0
  47. package/dist/today.js +19 -0
  48. package/dist/useUpload.d.ts +48 -0
  49. package/dist/useUpload.js +59 -0
  50. package/dist/values.d.ts +14 -0
  51. package/dist/values.js +36 -0
  52. package/package.json +35 -95
  53. package/dist/GinkoEditor.vue.d.ts +0 -96
  54. package/dist/GinkoImagePicker.vue.d.ts +0 -36
  55. package/dist/agent/AGENTS.md +0 -13
  56. package/dist/agent/pages/docs/getting-started/collaboration.md +0 -435
  57. package/dist/agent/pages/docs/getting-started/component-coverage.md +0 -107
  58. package/dist/agent/pages/docs/getting-started/customize.md +0 -384
  59. package/dist/agent/pages/docs/getting-started/images.md +0 -188
  60. package/dist/agent/pages/docs/getting-started/in-place-editing.md +0 -110
  61. package/dist/agent/pages/docs/getting-started/layout-blocks.md +0 -148
  62. package/dist/agent/pages/docs/getting-started/runtime.md +0 -111
  63. package/dist/agent/pages/docs/getting-started.md +0 -128
  64. package/dist/authoring-D7MJezVG.js +0 -1780
  65. package/dist/authoring-D7MJezVG.js.map +0 -1
  66. package/dist/authoring.d.ts +0 -122
  67. package/dist/authoring.js +0 -2
  68. package/dist/collaboration.d.ts +0 -14
  69. package/dist/collaboration.js +0 -907
  70. package/dist/collaboration.js.map +0 -1
  71. package/dist/composables/useAssetRequests.d.ts +0 -44
  72. package/dist/composables/useCollaborationBinding.d.ts +0 -59
  73. package/dist/composables/useDevice.d.ts +0 -10
  74. package/dist/composables/useInsertMenu.d.ts +0 -67
  75. package/dist/composables/useMarkdownSync.d.ts +0 -96
  76. package/dist/composables/useStableAuthoringKit.d.ts +0 -16
  77. package/dist/documentConfig-Z6LdrWZj.js +0 -2360
  78. package/dist/documentConfig-Z6LdrWZj.js.map +0 -1
  79. package/dist/editorProps.d.ts +0 -124
  80. package/dist/index.js.map +0 -1
  81. package/dist/layout-kit.d.ts +0 -922
  82. package/dist/lib/collaboration/presence-record.d.ts +0 -18
  83. package/dist/lib/collaboration/presence.d.ts +0 -103
  84. package/dist/lib/collaboration/protocol.d.ts +0 -133
  85. package/dist/lib/collaboration/recovery.d.ts +0 -45
  86. package/dist/lib/collaboration/session.d.ts +0 -163
  87. package/dist/lib/collaboration/validation.d.ts +0 -42
  88. package/dist/lib/component-converters.d.ts +0 -119
  89. package/dist/lib/config/documentConfig.d.ts +0 -19
  90. package/dist/lib/config/editorConfig.d.ts +0 -38
  91. package/dist/lib/container-items.d.ts +0 -55
  92. package/dist/lib/conversionInvariants.d.ts +0 -3
  93. package/dist/lib/conversionLogger.d.ts +0 -10
  94. package/dist/lib/conversionPipeline.d.ts +0 -17
  95. package/dist/lib/conversionState.d.ts +0 -10
  96. package/dist/lib/conversionTypes.d.ts +0 -50
  97. package/dist/lib/editor-operations.d.ts +0 -39
  98. package/dist/lib/environment.d.ts +0 -6
  99. package/dist/lib/extensions/code-block.d.ts +0 -18
  100. package/dist/lib/extensions/component-boundary.d.ts +0 -9
  101. package/dist/lib/extensions/container-items.d.ts +0 -29
  102. package/dist/lib/extensions/element.d.ts +0 -19
  103. package/dist/lib/extensions/file.d.ts +0 -24
  104. package/dist/lib/extensions/heading.d.ts +0 -5
  105. package/dist/lib/extensions/image-upload.d.ts +0 -39
  106. package/dist/lib/extensions/image.d.ts +0 -39
  107. package/dist/lib/extensions/index.d.ts +0 -10
  108. package/dist/lib/extensions/inline-element.d.ts +0 -13
  109. package/dist/lib/extensions/markdown-clipboard.d.ts +0 -21
  110. package/dist/lib/extensions/profile.d.ts +0 -11
  111. package/dist/lib/extensions/slot.d.ts +0 -16
  112. package/dist/lib/extensions/span-style.d.ts +0 -15
  113. package/dist/lib/extensions/video.d.ts +0 -15
  114. package/dist/lib/image-properties.d.ts +0 -20
  115. package/dist/lib/input-rules.d.ts +0 -7
  116. package/dist/lib/markdown.d.ts +0 -11
  117. package/dist/lib/marks.d.ts +0 -7
  118. package/dist/lib/mdcToTiptap.d.ts +0 -20
  119. package/dist/lib/mdcTypes.d.ts +0 -20
  120. package/dist/lib/nodes.d.ts +0 -57
  121. package/dist/lib/nodeviews/block-actions.d.ts +0 -7
  122. package/dist/lib/nodeviews/code.d.ts +0 -4
  123. package/dist/lib/nodeviews/columns.d.ts +0 -17
  124. package/dist/lib/nodeviews/component.d.ts +0 -6
  125. package/dist/lib/nodeviews/icons.d.ts +0 -26
  126. package/dist/lib/nodeviews/image.d.ts +0 -9
  127. package/dist/lib/nodeviews/items.d.ts +0 -15
  128. package/dist/lib/nodeviews/lifecycle.d.ts +0 -45
  129. package/dist/lib/nodeviews/popover.d.ts +0 -15
  130. package/dist/lib/nodeviews/settings.d.ts +0 -11
  131. package/dist/lib/nodeviews/table-operations.d.ts +0 -50
  132. package/dist/lib/nodeviews/table.d.ts +0 -4
  133. package/dist/lib/profiles.d.ts +0 -62
  134. package/dist/lib/property-input.d.ts +0 -10
  135. package/dist/lib/property-step.d.ts +0 -77
  136. package/dist/lib/props.d.ts +0 -13
  137. package/dist/lib/stripStyleNodes.d.ts +0 -2
  138. package/dist/lib/tiptapToMdc.d.ts +0 -18
  139. package/dist/presence-record-CLdPZWKC.js +0 -291
  140. package/dist/presence-record-CLdPZWKC.js.map +0 -1
  141. package/dist/runtime.d.ts +0 -13
  142. package/dist/runtime.js +0 -3
  143. package/dist/style.css +0 -2
  144. package/dist/types.d.ts +0 -126
  145. package/dist/ui/GinkoActionButton.vue.d.ts +0 -8
  146. package/dist/ui/GinkoInsertMenu.vue.d.ts +0 -49
  147. package/dist/ui/GinkoKeyboardDock.vue.d.ts +0 -15
  148. package/dist/ui/GinkoNodePopover.vue.d.ts +0 -21
  149. package/dist/ui/GinkoRecipeIcon.vue.d.ts +0 -6
  150. package/dist/ui/GinkoSelectionToolbar.vue.d.ts +0 -10
  151. package/dist/ui/GinkoToolbar.vue.d.ts +0 -26
  152. package/dist/ui/GinkoToolbarIcon.vue.d.ts +0 -6
  153. package/dist/ui/block-shortcuts.d.ts +0 -6
  154. package/dist/ui/commands.d.ts +0 -78
  155. package/dist/ui/context.d.ts +0 -23
  156. package/dist/ui/editor-keyboard.d.ts +0 -15
  157. package/dist/ui/messages.d.ts +0 -214
  158. package/dist/ui/messages.de.d.ts +0 -6
  159. package/dist/ui/recipe-command.d.ts +0 -14
  160. package/dist/ui/recipe-search.d.ts +0 -47
  161. package/dist/ui/slash-command.d.ts +0 -17
  162. package/dist/ui/writingRecipes.d.ts +0 -13
  163. package/skills/ginko-editor/SKILL.md +0 -40
  164. package/skills/ginko-editor/agents/openai.yaml +0 -4
  165. package/skills/ginko-editor/references/in-place-editing.md +0 -50
  166. package/skills/ginko-editor/references/quickstart.md +0 -55
@@ -1,8 +0,0 @@
1
- import type { EditorAction } from './commands.js';
2
- type __VLS_Props = {
3
- action: EditorAction;
4
- label?: boolean;
5
- };
6
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
- declare const _default: typeof __VLS_export;
8
- export default _default;
@@ -1,49 +0,0 @@
1
- import type { AuthoringRecipe } from '../authoring.js';
2
- import type { EditorText } from './messages.js';
3
- import type { RecipeGroup } from './recipe-search.js';
4
- type __VLS_Props = {
5
- id: string;
6
- to: InstanceType<typeof globalThis.HTMLElement> | string;
7
- origin: 'button' | 'slash';
8
- groups: readonly RecipeGroup[];
9
- busy: boolean;
10
- error: string | null;
11
- position: {
12
- left: string;
13
- top: string;
14
- maxHeight: string;
15
- };
16
- text: EditorText;
17
- };
18
- type __VLS_Slots = {
19
- 'recipe-preview'?: (props: {
20
- recipe: AuthoringRecipe;
21
- }) => unknown;
22
- };
23
- type __VLS_ModelProps = {
24
- 'query': string;
25
- 'activeIndex': number;
26
- };
27
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
28
- declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
29
- root: import("vue").Ref<HTMLElement | undefined, HTMLElement | undefined>;
30
- search: import("vue").Ref<HTMLInputElement | undefined, HTMLInputElement | undefined>;
31
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
32
- select: (recipe: AuthoringRecipe) => any;
33
- keydown: (event: KeyboardEvent) => any;
34
- "update:query": (value: string) => any;
35
- "update:activeIndex": (value: number) => any;
36
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
37
- onSelect?: ((recipe: AuthoringRecipe) => any) | undefined;
38
- onKeydown?: ((event: KeyboardEvent) => any) | undefined;
39
- "onUpdate:query"?: ((value: string) => any) | undefined;
40
- "onUpdate:activeIndex"?: ((value: number) => any) | undefined;
41
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
42
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
- declare const _default: typeof __VLS_export;
44
- export default _default;
45
- type __VLS_WithSlots<T, S> = T & {
46
- new (): {
47
- $slots: S;
48
- };
49
- };
@@ -1,15 +0,0 @@
1
- import type { EditorActions, EditorToolbarGroup } from './commands.js';
2
- type __VLS_Props = {
3
- actions: EditorActions;
4
- items?: readonly EditorToolbarGroup[];
5
- visible: boolean;
6
- };
7
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
- "open-change": (open: boolean) => any;
9
- "focus-change": (focused: boolean) => any;
10
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- "onOpen-change"?: ((open: boolean) => any) | undefined;
12
- "onFocus-change"?: ((focused: boolean) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
- declare const _default: typeof __VLS_export;
15
- export default _default;
@@ -1,21 +0,0 @@
1
- import { type CSSProperties } from 'vue';
2
- interface NodePopoverState {
3
- open: boolean;
4
- label: string;
5
- container: InstanceType<typeof globalThis.HTMLElement> | string;
6
- theme: CSSProperties;
7
- restoreFocus: boolean;
8
- }
9
- type __VLS_Props = {
10
- panel: InstanceType<typeof globalThis.HTMLDivElement>;
11
- state: NodePopoverState;
12
- };
13
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
- "update:open": (open: boolean) => any;
15
- "restore-focus": (restore: boolean) => any;
16
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- "onUpdate:open"?: ((open: boolean) => any) | undefined;
18
- "onRestore-focus"?: ((restore: boolean) => any) | undefined;
19
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
- declare const _default: typeof __VLS_export;
21
- export default _default;
@@ -1,6 +0,0 @@
1
- type __VLS_Props = {
2
- name?: string;
3
- };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
- declare const _default: typeof __VLS_export;
6
- export default _default;
@@ -1,10 +0,0 @@
1
- import type { Editor } from '@tiptap/core';
2
- import { type EditorActions, type EditorToolbarGroup } from './commands.js';
3
- type __VLS_Props = {
4
- editor: Editor;
5
- actions: EditorActions;
6
- items?: readonly EditorToolbarGroup[];
7
- };
8
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
- declare const _default: typeof __VLS_export;
10
- export default _default;
@@ -1,26 +0,0 @@
1
- import type { EditorActions, EditorToolbarGroup } from './commands.js';
2
- type __VLS_Props = {
3
- actions: EditorActions;
4
- items?: readonly EditorToolbarGroup[];
5
- compact?: boolean;
6
- };
7
- declare var __VLS_22: "image" | "file" | "video" | "table" | "bold" | "code" | "codeBlock" | "heading" | "italic" | "link" | "bulletList" | "orderedList" | "paragraph" | "strike" | "undo" | "redo" | "blockquote" | "insert" | "divider" | "menu", __VLS_23: {
8
- action: import("./commands.js").EditorAction | undefined;
9
- actions: EditorActions;
10
- };
11
- type __VLS_Slots = {} & {
12
- [K in NonNullable<typeof __VLS_22>]?: (props: typeof __VLS_23) => any;
13
- };
14
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
- "open-change": (open: boolean) => any;
16
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
- "onOpen-change"?: ((open: boolean) => any) | undefined;
18
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
- declare const _default: typeof __VLS_export;
21
- export default _default;
22
- type __VLS_WithSlots<T, S> = T & {
23
- new (): {
24
- $slots: S;
25
- };
26
- };
@@ -1,6 +0,0 @@
1
- type __VLS_Props = {
2
- name: string;
3
- };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
- declare const _default: typeof __VLS_export;
6
- export default _default;
@@ -1,6 +0,0 @@
1
- import type { Editor } from '@tiptap/core';
2
- import { type EditorOperationContext } from '../lib/editor-operations.js';
3
- import { type EditorShortcuts } from './commands.js';
4
- export type BlockKeyboardIntent = 'duplicate' | 'duplicate-component' | 'escape' | 'write';
5
- export declare function blockKeyboardIntent(editor: Editor, event: KeyboardEvent, shortcuts?: EditorShortcuts): BlockKeyboardIntent | undefined;
6
- export declare function handleBlockShortcut(editor: Editor, event: KeyboardEvent, context: EditorOperationContext, shortcuts?: EditorShortcuts): boolean;
@@ -1,78 +0,0 @@
1
- import { defaultMessages, type EditorMessages } from './messages.js';
2
- export { defaultMessages, type EditorMessages } from './messages.js';
3
- import type { Editor } from '@tiptap/core';
4
- import { type Ref } from 'vue';
5
- import type { Transaction } from '@tiptap/pm/state';
6
- import { type EditorOperationContext } from '../lib/editor-operations.js';
7
- import { type EditorProfile } from '../lib/profiles.js';
8
- export type EditorCommand = {
9
- kind: 'undo' | 'redo' | 'paragraph' | 'bulletList' | 'orderedList' | 'blockquote' | 'codeBlock' | 'divider' | 'image' | 'file' | 'video' | 'insert';
10
- } | {
11
- kind: 'heading';
12
- level: 1 | 2 | 3 | 4 | 5 | 6;
13
- } | {
14
- kind: 'mark';
15
- mark: 'bold' | 'italic' | 'strike' | 'code';
16
- } | {
17
- kind: 'link';
18
- href?: string;
19
- } | {
20
- kind: 'table';
21
- rows: number;
22
- columns: number;
23
- };
24
- export type EditorToolbarItem = EditorCommand | {
25
- kind: 'menu';
26
- label: string;
27
- items: readonly EditorCommand[];
28
- };
29
- export type EditorToolbarGroup = readonly EditorToolbarItem[];
30
- export type EditorShortcuts = Partial<Record<'duplicate' | 'undo' | 'redo' | 'bold' | 'italic' | 'strike' | 'code', string | false>>;
31
- export interface EditorAction {
32
- id: string;
33
- label: string;
34
- shortcut?: string;
35
- active: boolean;
36
- disabled: boolean;
37
- pending: boolean;
38
- available: boolean;
39
- value?: string;
40
- /** True means the command was accepted; asset completion remains asynchronous. */
41
- run: () => Promise<boolean>;
42
- }
43
- export interface EditorActions {
44
- get: (command: EditorCommand) => EditorAction;
45
- text: (key: keyof typeof defaultMessages) => string;
46
- capture: () => EditorActions;
47
- isCurrent: () => boolean;
48
- }
49
- export declare const defaultToolbarItems: readonly EditorToolbarGroup[];
50
- /** Formatting that the floating selection toolbar offers by default. */
51
- export declare const defaultSelectionToolbarItems: readonly EditorToolbarGroup[];
52
- /** Whether a command can create content that the profile allows. */
53
- export declare function profileAllowsCommand(profile: EditorProfile, command: EditorCommand): boolean;
54
- export declare function formatShortcut(value: string, mac?: boolean): string;
55
- export declare function matchesShortcut(event: KeyboardEvent, value: string | false | undefined): boolean;
56
- export declare function hasCustomActionShortcut(event: KeyboardEvent, shortcuts?: EditorShortcuts): boolean;
57
- /** Capture-phase routing keeps UI, shortcuts, and policy validation in agreement. */
58
- export declare function handleActionShortcut(editor: Editor, event: KeyboardEvent, actions: EditorActions, shortcuts?: EditorShortcuts): boolean;
59
- type CommandHostActions = {
60
- image: () => void;
61
- file: () => void;
62
- video: () => void;
63
- insert: () => void;
64
- mediaEnabled: (kind: 'image' | 'file' | 'video') => boolean;
65
- };
66
- /** Build the same native document edit used by toolbar actions, without dispatching it. */
67
- export declare function buildEditorCommandTransaction(editor: Editor, command: EditorCommand, replaceRange?: {
68
- from: number;
69
- to: number;
70
- }): Transaction | undefined;
71
- export declare function useEditorActions(editor: Ref<Editor | undefined>, options: CommandHostActions & {
72
- enabled: () => boolean;
73
- messages: () => EditorMessages | undefined;
74
- shortcuts: () => EditorShortcuts | undefined;
75
- context: EditorOperationContext;
76
- /** The content profile. Commands outside it are unavailable. */
77
- profile?: EditorProfile;
78
- }): import("vue").ComputedRef<EditorActions>;
@@ -1,23 +0,0 @@
1
- import { type InjectionKey } from 'vue';
2
- import { type EditorMessages, type EditorMessageKey } from './messages.js';
3
- export interface EditorOverlayOptions {
4
- getContainer?: () => HTMLElement | undefined;
5
- getThemeElement?: () => HTMLElement | undefined;
6
- getMessages?: () => EditorMessages | undefined;
7
- }
8
- /** One controller belongs to one editor, including its toolbar and node views. */
9
- export declare function createEditorOverlayController(options?: EditorOverlayOptions): {
10
- active: Readonly<import("vue").ShallowRef<object | undefined, object | undefined>>;
11
- open(owner: object, close: () => void): void;
12
- close(owner?: object): void;
13
- release(owner: object): void;
14
- getContainer: () => HTMLElement | undefined;
15
- getThemeElement: () => HTMLElement | undefined;
16
- text: (key: EditorMessageKey, parameters?: Readonly<Record<string, string | number>>) => string;
17
- /** Changes when the host replaces or edits its messages. */
18
- messagesRevision: () => number;
19
- notifyMessagesChanged(): void;
20
- destroy(): void;
21
- };
22
- export type EditorOverlayController = ReturnType<typeof createEditorOverlayController>;
23
- export declare const editorOverlayKey: InjectionKey<EditorOverlayController>;
@@ -1,15 +0,0 @@
1
- import type { Editor } from '@tiptap/core';
2
- import type { EditorOperationContext } from '../lib/editor-operations.js';
3
- import { type EditorActions, type EditorShortcuts } from './commands.js';
4
- export interface EditorKeyboardContext {
5
- actions: EditorActions;
6
- shortcuts?: EditorShortcuts;
7
- operationContext: EditorOperationContext;
8
- insertMenuOpen: boolean;
9
- handleInsertKeys: (event: KeyboardEvent) => boolean;
10
- }
11
- /**
12
- * Capture-phase routing for the writing surface. Custom shortcuts win over
13
- * defaults, then formatting actions, block shortcuts, and the open insert menu.
14
- */
15
- export declare function routeEditorKeydown(editor: Editor, event: KeyboardEvent, context: EditorKeyboardContext): void;
@@ -1,214 +0,0 @@
1
- export declare const defaultMessages: {
2
- contentLabel: string;
3
- markdownSourceLabel: string;
4
- startWriting: string;
5
- editorNotReady: string;
6
- sourceOnlyRequired: string;
7
- copyFailed: string;
8
- pasteRejected: string;
9
- insertRecipe: string;
10
- editingMode: string;
11
- availableBlocks: string;
12
- insertShort: string;
13
- navigate: string;
14
- insertHelp: string;
15
- closeHelp: string;
16
- changesNeedAttention: string;
17
- sourceOnly: string;
18
- convertingChanges: string;
19
- visualEditor: string;
20
- markdownSource: string;
21
- sharedConnecting: string;
22
- sharedSyncing: string;
23
- sharedSynced: string;
24
- sharedOffline: string;
25
- sharedError: string;
26
- sharedStale: string;
27
- sharedClosed: string;
28
- sharedTableLayout: string;
29
- sharedRetry: string;
30
- sharedRecovery: string;
31
- sharedDiscard: string;
32
- sharedPeers: string;
33
- sharedRemount: string;
34
- finishImageUpload: string;
35
- visualRecovery: string;
36
- sourceUnavailable: string;
37
- undo: string;
38
- redo: string;
39
- paragraph: string;
40
- heading: string;
41
- textStyle: string;
42
- lists: string;
43
- bulletList: string;
44
- orderedList: string;
45
- blockquote: string;
46
- codeBlock: string;
47
- divider: string;
48
- bold: string;
49
- italic: string;
50
- strike: string;
51
- code: string;
52
- link: string;
53
- image: string;
54
- file: string;
55
- video: string;
56
- insert: string;
57
- table: string;
58
- rows: string;
59
- columns: string;
60
- apply: string;
61
- removeLink: string;
62
- linkAddress: string;
63
- invalidLink: string;
64
- formatting: string;
65
- more: string;
66
- visual: string;
67
- markdown: string;
68
- searchBlocks: string;
69
- noBlocks: string;
70
- noBlocksHint: string;
71
- blockResults: string;
72
- groupRecent: string;
73
- groupContext: string;
74
- groupText: string;
75
- groupLists: string;
76
- groupMedia: string;
77
- groupLayout: string;
78
- groupCallouts: string;
79
- groupAdvanced: string;
80
- groupComponents: string;
81
- previewHelp: string;
82
- recipePreview: string;
83
- insertFailed: string;
84
- heading1Description: string;
85
- heading2Description: string;
86
- heading3Description: string;
87
- bulletListDescription: string;
88
- orderedListDescription: string;
89
- blockquoteDescription: string;
90
- codeBlockDescription: string;
91
- dividerDescription: string;
92
- imageRecipeDescription: string;
93
- tableDescription: string;
94
- duplicate: string;
95
- delete: string;
96
- cancel: string;
97
- loading: string;
98
- loadMore: string;
99
- upload: string;
100
- blockSettings: string;
101
- componentSettings: string;
102
- calloutType: string;
103
- defaultValue: string;
104
- emptyText: string;
105
- invalidNumber: string;
106
- componentConversionFailed: string;
107
- variantInvalid: string;
108
- variantFailed: string;
109
- columnWidths: string;
110
- customWidths: string;
111
- resizeColumns: string;
112
- columnSize: string;
113
- componentTitle: string;
114
- title: string;
115
- addTitle: string;
116
- resizeColumnsHint: string;
117
- addItem: string;
118
- containerItems: string;
119
- untitledItem: string;
120
- itemName: string;
121
- renameItem: string;
122
- removeItem: string;
123
- confirmRemoveItem: string;
124
- collapseItem: string;
125
- expandItem: string;
126
- itemTabHint: string;
127
- itemChangeFailed: string;
128
- invalidJson: string;
129
- valueRequired: string;
130
- tableEditing: string;
131
- tableOptions: string;
132
- rowActions: string;
133
- columnActions: string;
134
- tableScope: string;
135
- tableRow: string;
136
- tableRows: string;
137
- tableColumn: string;
138
- tableColumns: string;
139
- tableRangeActions: string;
140
- tableActionScope: string;
141
- columnAlignment: string;
142
- addToTable: string;
143
- alignColumnLeft: string;
144
- alignColumnCenter: string;
145
- alignColumnRight: string;
146
- addRow: string;
147
- addColumn: string;
148
- addRowAbove: string;
149
- addRowBelow: string;
150
- addColumnLeft: string;
151
- addColumnRight: string;
152
- moveRowUp: string;
153
- moveRowDown: string;
154
- moveColumnLeft: string;
155
- moveColumnRight: string;
156
- duplicateRow: string;
157
- duplicateColumn: string;
158
- deleteRow: string;
159
- deleteColumn: string;
160
- moveRowToHeader: string;
161
- deleteTable: string;
162
- tableHeaderHint: string;
163
- imageSettings: string;
164
- imageDescription: string;
165
- replaceImage: string;
166
- imageMetadata: string;
167
- removeImage: string;
168
- codeLanguage: string;
169
- plainText: string;
170
- shellLanguage: string;
171
- codeFileName: string;
172
- optionalFileName: string;
173
- chooseImage: string;
174
- imagePickerDescription: string;
175
- closeImagePicker: string;
176
- searchImages: string;
177
- searchImagesPlaceholder: string;
178
- imageLibrary: string;
179
- chooseNamedImage: string;
180
- loadingImages: string;
181
- noMatchingImages: string;
182
- noImages: string;
183
- imageUpload: string;
184
- uploadImage: string;
185
- imageUploadHint: string;
186
- browseImages: string;
187
- imageFile: string;
188
- removeImagePlaceholder: string;
189
- confirmReplaceImage: string;
190
- confirmAddImage: string;
191
- imageTooLarge: string;
192
- invalidImageFile: string;
193
- choosingImage: string;
194
- uploadingImage: string;
195
- retryImage: string;
196
- replaceImageDrop: string;
197
- uploadImageDrop: string;
198
- imageInsertFailed: string;
199
- imageUploadFailed: string;
200
- oneImagePlaceholder: string;
201
- dropReplaceImage: string;
202
- dropAddImage: string;
203
- oneImageDrop: string;
204
- imageReferenceRequired: string;
205
- imageTextRequired: string;
206
- imageNumberRequired: string;
207
- };
208
- export type EditorMessageKey = keyof typeof defaultMessages;
209
- export type EditorMessages = Partial<Record<EditorMessageKey, string>>;
210
- export type EditorMessageParams = Readonly<Record<string, string | number>>;
211
- export type EditorText = (key: EditorMessageKey, params?: EditorMessageParams) => string;
212
- export declare function translateEditorMessage(messages: EditorMessages | undefined, key: EditorMessageKey, params?: EditorMessageParams): string;
213
- /** Resolve UI copy at use time so changing a host's locale needs no new editor. */
214
- export declare function createEditorText(getMessages?: () => EditorMessages | undefined): EditorText;
@@ -1,6 +0,0 @@
1
- import type { EditorMessageKey } from './messages.js';
2
- /**
3
- * German interface text. Instructions use the infinitive, so the set fits
4
- * sites that address people with "du" and sites that use "Sie".
5
- */
6
- export declare const germanMessages: Readonly<Record<EditorMessageKey, string>>;
@@ -1,14 +0,0 @@
1
- import type { Editor } from '@tiptap/core';
2
- import type { AuthoringRecipe } from '../authoring.js';
3
- import { type EditorOperationContext, type BlockOperationResult } from '../lib/editor-operations.js';
4
- import { type EditorProfile } from '../lib/profiles.js';
5
- /**
6
- * Built-in recipes follow their command. Host recipes insert arbitrary
7
- * content, so only the unrestricted profile offers them.
8
- */
9
- export declare function profileAllowsRecipe(profile: EditorProfile, recipe: AuthoringRecipe): boolean;
10
- /** Slash insertion shares toolbar commands and Content's final-document gate. */
11
- export declare function runRecipeCommand(editor: Editor, recipe: AuthoringRecipe, context: EditorOperationContext, replaceRange?: {
12
- from: number;
13
- to: number;
14
- }): Promise<BlockOperationResult>;
@@ -1,47 +0,0 @@
1
- import type { AuthoringRecipe } from '../authoring.js';
2
- import type { EditorText } from './messages.js';
3
- /** Match quality. A higher score ranks first; equal scores keep their source order. */
4
- export declare const matchScore: {
5
- readonly exact: 5;
6
- readonly prefix: 4;
7
- readonly wordPrefix: 3;
8
- readonly keyword: 2;
9
- readonly fuzzy: 1;
10
- };
11
- export interface RecipeMatch {
12
- recipe: AuthoringRecipe;
13
- label: string;
14
- description?: string;
15
- score: number;
16
- /** Source order, used to keep ranking stable. */
17
- order: number;
18
- /** Matched label characters as `[start, end)` ranges. */
19
- ranges: readonly (readonly [number, number])[];
20
- }
21
- export interface RecipeGroup {
22
- key: string;
23
- label: string;
24
- matches: RecipeMatch[];
25
- }
26
- /** Built-in groups in their menu order. Host groups follow `callouts`. */
27
- export declare const builtInGroups: readonly ["text", "lists", "media", "layout", "callouts"];
28
- /** Rank recipes for a query. An empty query keeps every recipe in source order. */
29
- export declare function rankRecipes(recipes: readonly AuthoringRecipe[], query: string, copy: (recipe: AuthoringRecipe) => {
30
- label: string;
31
- description?: string;
32
- }): RecipeMatch[];
33
- /** Keep the old flat search for callers that need only the recipes. */
34
- export declare function searchRecipes(recipes: readonly AuthoringRecipe[], query: string, copy: (recipe: AuthoringRecipe) => {
35
- label: string;
36
- description?: string;
37
- }): AuthoringRecipe[];
38
- export declare function groupKey(recipe: AuthoringRecipe): string;
39
- export declare function groupLabel(key: string, text: EditorText): string;
40
- /**
41
- * Group ranked matches. With a query, groups follow their best match; with no
42
- * query, they follow the built-in order. Pinned groups always come first.
43
- */
44
- export declare function groupMatches(matches: readonly RecipeMatch[], text: EditorText, options: {
45
- query: boolean;
46
- pinned?: readonly RecipeGroup[];
47
- }): RecipeGroup[];
@@ -1,17 +0,0 @@
1
- import { Extension } from '@tiptap/core';
2
- import { PluginKey } from '@tiptap/pm/state';
3
- export interface SlashRange {
4
- from: number;
5
- to: number;
6
- query: string;
7
- }
8
- interface SlashState {
9
- active?: SlashRange;
10
- dismissed?: number;
11
- }
12
- export declare const slashKey: PluginKey<SlashState>;
13
- /** Slash text belongs to the document. Only its menu state is ephemeral. */
14
- export declare const SlashCommands: Extension<{
15
- enabled: () => boolean;
16
- }, any>;
17
- export {};
@@ -1,13 +0,0 @@
1
- import type { AuthoringRecipe } from '../authoring.js';
2
- import type { EditorText } from './messages.js';
3
- export declare function isImageRecipe(recipe: AuthoringRecipe): boolean;
4
- /** Sources illustrate the preview slot. Built-in insertion runs the matching
5
- * toolbar command on the current selection; it does not insert this sample text.
6
- * Host recipe sources are prepared and validated as document fragments instead.
7
- */
8
- export declare const writingRecipes: readonly AuthoringRecipe[];
9
- /** Preserve recipe identity: host IDs must not acquire built-in behavior. */
10
- export declare function recipeCopy(recipe: AuthoringRecipe, text: EditorText): AuthoringRecipe | {
11
- label: string;
12
- description: string;
13
- };
@@ -1,40 +0,0 @@
1
- ---
2
- name: ginko-editor
3
- description: Use when an agent embeds or configures @lupinum/ginko-editor in a Vue or Nuxt app, including the GinkoEditor component, v-model and flush() persistence, toolbar and messages (German germanMessages), in-place editing with variant="inline", content profiles (plain, inline, article), the keyboard-docked toolbar, image and asset hooks, authoring kits, or server-side validation with the runtime entry.
4
- ---
5
-
6
- # Ginko Editor
7
-
8
- Use this skill for app-facing work with `@lupinum/ginko-editor`. It is for apps that embed the editor, not for changing the editor's internals.
9
-
10
- ## Workflow
11
-
12
- 1. Inspect the app first: `package.json`, `nuxt.config.ts` or the Vue entry, and every place that mounts `GinkoEditor` or saves its value.
13
- 2. Read only the matching reference:
14
- - First setup, persistence, and flush: [references/quickstart.md](references/quickstart.md)
15
- - Editing text on the page, profiles, phones: [references/in-place-editing.md](references/in-place-editing.md)
16
- 3. Keep the app's own UI conventions for buttons, dialogs, and theme tokens.
17
- 4. Validate with the smallest relevant command, then the app's gates.
18
-
19
- ## Hard rules
20
-
21
- - Import the styles once: `import '@lupinum/ginko-editor/style.css'`.
22
- - Markdown (MDC) in `v-model` is the only document format. Do not store TipTap JSON.
23
- - Await `editorRef.value.flush()` before you save, close, or replace a document. Keep the editor mounted when it returns `{ ok: false }`.
24
- - The host owns persistence and asset storage. Use `imageUpload`, `imagePicker`, and `request-*` events; never put upload credentials in the editor.
25
- - `profile` and `collaboration` are read once at mount. Remount (change the `key`) to change them.
26
- - A profile limits what the editor creates, but loaded content is not changed. Enforce the same profile where the document is stored with `findProfileViolations` from `@lupinum/ginko-editor/runtime`.
27
- - Server code imports only `@lupinum/ginko-editor/runtime`. It has no Vue or browser globals.
28
- - `@lupinum/ginko-content` is a peer dependency. Keep one copy (`vite.resolve.dedupe` in Nuxt).
29
- - Pass `messages` for non-English UI. `germanMessages` is complete; spread it to override single keys.
30
-
31
- ## Validation
32
-
33
- ```bash
34
- pnpm typecheck
35
- pnpm test
36
- pnpm build
37
- ```
38
-
39
- Check real behavior in a browser: type, format, paste, and reload after a save.
40
- On phones, check that the docked formatting row stays above the keyboard.
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Ginko Editor"
3
- short_description: "Agent guide for apps that embed Ginko Editor"
4
- default_prompt: "Use $ginko-editor to embed, configure, or validate Ginko Editor in this Vue or Nuxt app."