@kungal/editor-vue 0.16.0 → 0.17.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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @kungal/editor-vue
2
2
 
3
+ ## 0.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 59abbc8: Add a placeholder (empty-state text).
8
+
9
+ - **editor-core**: `createPlaceholderPlugin({ text, mode })` — a `$prose` plugin
10
+ that adds a ProseMirror node DECORATION to the empty block (`.kun-editor__placeholder`
11
+ class + `data-placeholder` attribute). Same mechanism as Milkdown Crepe's v7
12
+ placeholder feature — purely visual (a decoration), so it never enters the doc
13
+ or the markdown output. `mode` `'block'` (default) shows on any empty block,
14
+ `'doc'` only when the whole document is empty; skipped in readonly / code blocks
15
+ / lists / tables. `createKunEditorPlugins(..., { placeholder, placeholderMode })`
16
+ wires it (only when `placeholder` is non-empty). Exported from `/preset`.
17
+ - **editor-vue**: `<KunEditor placeholder="…">` prop, threaded through.
18
+ - **Headless**: the core ships only the class + `data-placeholder` hook; render it
19
+ with `.kun-editor__placeholder::before { content: attr(data-placeholder) }` (added
20
+ to the reference `kun-editor.css`, muted via a KunUI token).
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [59abbc8]
25
+ - @kungal/editor-core@0.17.0
26
+
3
27
  ## 0.16.0
4
28
 
5
29
  ### Patch Changes
@@ -11,6 +11,8 @@ type __VLS_Props = {
11
11
  locale?: KunEditorLocale;
12
12
  /** Read-only render (no editing). */
13
13
  readonly?: boolean;
14
+ /** Placeholder text shown while the editor is empty. */
15
+ placeholder?: string;
14
16
  };
15
17
  type ViewMode = 'wysiwyg' | 'source';
16
18
  declare var __VLS_1: {
@@ -50,6 +52,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, KunEditorEx
50
52
  features: KunEditorFeatures;
51
53
  locale: KunEditorLocale;
52
54
  readonly: boolean;
55
+ placeholder: string;
53
56
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
54
57
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
55
58
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"KunEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/KunEditor.vue"],"names":[],"mappings":"AAkLA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAM5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,WAAW,GAAG;IACf,gCAAgC;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,qDAAqD;IACrD,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAC;AAoCJ,KAAK,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;AA2MpC,QAAA,IAAI,OAAO;;iBAzMS,QAAQ;;;;;CAyMP,EAAE,QAAQ;iEAzQ/B,CArKwB;;;;;;;;;;;;;;CA8awC,CAAE;AAClE,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAClD;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAOhD,QAAA,MAAM,UAAU;;;;;cAhQD,iBAAiB;cAEjB,iBAAiB;YAEnB,eAAe;cAEb,OAAO;6EA+PpB,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,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EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AAWzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -6,6 +6,7 @@ type __VLS_Props = {
6
6
  features: KunEditorFeatures;
7
7
  locale: KunEditorLocale;
8
8
  readonly: boolean;
9
+ placeholder: string;
9
10
  };
10
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, KunEditorExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
12
  "update:modelValue": (markdown: string) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"MilkdownEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/MilkdownEditor.vue"],"names":[],"mappings":"AAwKA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAC;AA6HF,QAAA,MAAM,YAAY;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"MilkdownEditor.vue.d.ts","sourceRoot":"","sources":["../../src/components/MilkdownEditor.vue"],"names":[],"mappings":"AA0KA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAC;AA8HF,QAAA,MAAM,YAAY;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
package/dist/index.js CHANGED
@@ -145,7 +145,8 @@ var q = Symbol("kun-editor-context"), _e = [
145
145
  adapters: {},
146
146
  features: {},
147
147
  locale: {},
148
- readonly: { type: Boolean }
148
+ readonly: { type: Boolean },
149
+ placeholder: {}
149
150
  },
150
151
  emits: ["update:modelValue"],
151
152
  setup(e, { expose: t, emit: r }) {
@@ -157,7 +158,10 @@ var q = Symbol("kun-editor-context"), _e = [
157
158
  ...e,
158
159
  editable: () => !i.readonly
159
160
  })), l && t.set(c.key, { view: s({ component: we }) });
160
- }).use(ne(i.adapters, i.features, { locale: i.locale }));
161
+ }).use(ne(i.adapters, i.features, {
162
+ locale: i.locale,
163
+ placeholder: i.placeholder
164
+ }));
161
165
  return l && t.use(c), t;
162
166
  });
163
167
  x(() => i.modelValue, (e) => {
@@ -555,7 +559,8 @@ var q = Symbol("kun-editor-context"), _e = [
555
559
  readonly: {
556
560
  type: Boolean,
557
561
  default: !1
558
- }
562
+ },
563
+ placeholder: { default: "" }
559
564
  },
560
565
  emits: ["update:modelValue"],
561
566
  setup(e, { expose: s, emit: l }) {
@@ -615,13 +620,15 @@ var q = Symbol("kun-editor-context"), _e = [
615
620
  features: e.features,
616
621
  locale: e.locale,
617
622
  readonly: e.readonly,
623
+ placeholder: e.placeholder,
618
624
  "onUpdate:modelValue": D
619
625
  }, null, 8, [
620
626
  "model-value",
621
627
  "adapters",
622
628
  "features",
623
629
  "locale",
624
- "readonly"
630
+ "readonly",
631
+ "placeholder"
625
632
  ])], 512), [[b, g.value === "wysiwyg"]])]),
626
633
  _: 3
627
634
  })]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kungal/editor-vue",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "KunEditor Vue 3 layer — the headless <KunEditor> component (dual WYSIWYG / markdown-source), toolbar and plugin views. Ships zero CSS and no UI-kit dependency; consumes @kungal/editor-core, and pairs with @kungal/editor-nuxt for optional KunUI chrome.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@prosemirror-adapter/vue": "^0.4.6",
43
- "@kungal/editor-core": "0.16.0"
43
+ "@kungal/editor-core": "0.17.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@codemirror/lang-markdown": "^6.0.0",
@@ -80,7 +80,7 @@
80
80
  "vite": "^8.0.16",
81
81
  "vue": "^3.5.35",
82
82
  "vue-tsc": "^3.3.3",
83
- "@kungal/editor-core": "0.16.0"
83
+ "@kungal/editor-core": "0.17.0"
84
84
  },
85
85
  "scripts": {
86
86
  "build": "vite build && vue-tsc -p tsconfig.build.json",