@haklex/rich-ext-gallery 0.5.0 → 0.6.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/README.md CHANGED
@@ -10,46 +10,57 @@ pnpm add @haklex/rich-ext-gallery
10
10
 
11
11
  ## Peer Dependencies
12
12
 
13
- | Package | Version |
14
- | --- | --- |
15
- | `lexical` | `^0.41.0` |
13
+ | Package | Version |
14
+ | -------------- | ---------- |
15
+ | `lexical` | `^0.41.0` |
16
16
  | `lucide-react` | `^0.574.0` |
17
- | `react` | `>= 19` |
18
- | `react-dom` | `>= 19` |
17
+ | `react` | `>= 19` |
18
+ | `react-dom` | `>= 19` |
19
19
 
20
20
  ## Usage
21
21
 
22
- ### Register nodes in your editor config
22
+ ### Register nodes
23
+
24
+ Edit (read + write):
23
25
 
24
26
  ```ts
25
- import { galleryEditNodes } from '@haklex/rich-ext-gallery'
27
+ import { galleryEditNodes } from '@haklex/rich-ext-gallery/edit';
26
28
 
27
- const editorConfig = {
28
- nodes: [...galleryEditNodes],
29
- }
29
+ const editorConfig = { nodes: [...galleryEditNodes] };
30
30
  ```
31
31
 
32
- For static/read-only rendering:
32
+ Static / read-only:
33
33
 
34
34
  ```ts
35
- import { galleryNodes } from '@haklex/rich-ext-gallery/static'
35
+ import { galleryNodes } from '@haklex/rich-ext-gallery/node';
36
36
 
37
- const staticConfig = {
38
- nodes: [...galleryNodes],
39
- }
37
+ const staticConfig = { nodes: [...galleryNodes] };
40
38
  ```
41
39
 
42
40
  ### Use renderers
43
41
 
44
42
  ```tsx
45
- import { GalleryEditRenderer } from '@haklex/rich-ext-gallery'
46
- import { GalleryRenderer } from '@haklex/rich-ext-gallery/static'
43
+ import { GalleryEditRenderer } from '@haklex/rich-ext-gallery/edit';
44
+ import { GalleryRenderer } from '@haklex/rich-ext-gallery/renderer';
45
+ ```
46
+
47
+ ### Tree-shake the default renderer
48
+
49
+ ```ts
50
+ import { GALLERY_NODE_KEY, galleryNodes } from '@haklex/rich-ext-gallery/node';
51
+ import type { RichRendererModule } from '@haklex/rich-compose';
52
+
53
+ const lightModule: RichRendererModule = {
54
+ name: 'gallery',
55
+ nodes: galleryNodes,
56
+ renderers: { [GALLERY_NODE_KEY]: MyLightGallery },
57
+ };
47
58
  ```
48
59
 
49
60
  ### Import styles
50
61
 
51
62
  ```ts
52
- import '@haklex/rich-ext-gallery/style.css'
63
+ import '@haklex/rich-ext-gallery/style.css';
53
64
  ```
54
65
 
55
66
  ## Exports
@@ -67,18 +78,26 @@ import '@haklex/rich-ext-gallery/style.css'
67
78
  - `GalleryRenderer` -- static renderer (grid/carousel display)
68
79
  - `GalleryEditRenderer` -- edit renderer with drag-and-drop support
69
80
 
81
+ ### Slot Key
82
+
83
+ - `GALLERY_NODE_KEY` -- `'Gallery'` constant for `RendererConfig` slot lookup
84
+
70
85
  ### Types
71
86
 
72
87
  - `GalleryNodePayload` -- payload type for creating gallery nodes
73
88
  - `SerializedGalleryNode` -- serialized gallery node type
74
-
75
- ### Sub-path Exports
76
-
77
- | Path | Description |
78
- | --- | --- |
79
- | `@haklex/rich-ext-gallery` | Full exports (edit + static) |
80
- | `@haklex/rich-ext-gallery/static` | Static-only (no drag-and-drop deps) |
81
- | `@haklex/rich-ext-gallery/style.css` | Stylesheet |
89
+ - `GalleryRendererProps` -- renderer props (also flowed into `RendererConfig.Gallery` via module augmentation)
90
+
91
+ ## Sub-path Exports
92
+
93
+ | Path | Description |
94
+ | ------------------------------------ | --------------------------------------------------------- |
95
+ | `@haklex/rich-ext-gallery` | Full exports (node + renderer + edit) |
96
+ | `@haklex/rich-ext-gallery/node` | Lightweight node + slot key + types — no default renderer |
97
+ | `@haklex/rich-ext-gallery/renderer` | Default `GalleryRenderer` (heavy) |
98
+ | `@haklex/rich-ext-gallery/edit` | Edit-mode node + `GalleryEditRenderer` |
99
+ | `@haklex/rich-ext-gallery/static` | Convenience: node + renderer (SSR bundle) |
100
+ | `@haklex/rich-ext-gallery/style.css` | Stylesheet |
82
101
 
83
102
  ## Part of Haklex
84
103
 
@@ -1 +1 @@
1
- {"version":3,"file":"augment.d.ts","sourceRoot":"","sources":["../src/augment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,cAAc;QACtB,OAAO,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAA;KAC9C;CACF;AAED,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"augment.d.ts","sourceRoot":"","sources":["../src/augment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,cAAc;QACtB,OAAO,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;KAC/C;CACF;AAED,OAAO,EAAE,CAAC"}
package/dist/edit.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Klass, LexicalNode } from 'lexical';
2
- export { $createGalleryEditNode, $isGalleryEditNode, GalleryEditNode, } from './GalleryEditNode';
2
+ export { $createGalleryEditNode, $isGalleryEditNode, GalleryEditNode } from './GalleryEditNode';
3
3
  export { GalleryEditRenderer } from './GalleryEditRenderer';
4
4
  export declare const galleryEditNodes: Array<Klass<LexicalNode>>;
5
5
  //# sourceMappingURL=edit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../src/edit.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIjD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAqB,CAAA"}
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../src/edit.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAIlD,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAChG,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAqB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAA;AAElB,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAIjD,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC9E,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AACzC,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEjE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAiB,CAAA"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,CAAC;AAEnB,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAIlD,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AACrB,OAAO,WAAW,CAAA;AAElB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC5D,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,WAAW,CAAC;AAEnB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../src/slot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAG,SAAkB,CAAA"}
1
+ {"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../src/slot.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAG,SAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["../src/static.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,cAAc,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,EAAE,CAAA;IACtB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;IACvC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,IAAI,CAAA;IACjD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,KAAK,IAAI,CAAA;CACnE"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;IACxC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,KAAK,IAAI,CAAC;CACpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-ext-gallery",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Image gallery extension with drag-and-drop",
5
5
  "repository": {
6
6
  "type": "git",
@@ -61,9 +61,9 @@
61
61
  "lucide-react": "^1.0.0",
62
62
  "react": ">=19",
63
63
  "react-dom": ">=19",
64
- "@haklex/rich-editor": "0.5.0",
65
- "@haklex/rich-editor-ui": "0.5.0",
66
- "@haklex/rich-style-token": "0.5.0"
64
+ "@haklex/rich-editor": "0.6.0",
65
+ "@haklex/rich-editor-ui": "0.6.0",
66
+ "@haklex/rich-style-token": "0.6.0"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public"