@clepit/react 0.2.1 → 0.3.0-beta.396
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/editor.cjs +1 -1
- package/dist/editor.d.cts +1 -1
- package/dist/editor.d.ts +1 -1
- package/dist/editor.js +1 -1
- package/package.json +10 -10
package/dist/editor.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";"use client";var
|
|
2
|
+
"use strict";"use client";var u=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var U=(i,r)=>{for(var t in r)u(i,t,{get:r[t],enumerable:!0})},P=(i,r,t,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let d of I(r))!E.call(i,d)&&d!==t&&u(i,d,{get:()=>r[d],enumerable:!(l=v(r,d))||l.enumerable});return i};var A=i=>P(u({},"__esModule",{value:!0}),i);var y={};U(y,{ClepitEditor:()=>C});module.exports=A(y);var f=require("@clepit/core"),s=require("react"),p=require("react/jsx-runtime"),C=({className:i,id:r,onApi:t,testId:l,...d})=>{let g=(0,s.useId)(),a=r??`clepit-editor-${g.replace(/[^a-zA-Z0-9_-]/g,"")}`,n=(0,s.useRef)({config:d,onApi:t});return n.current={config:d,onApi:t},(0,s.useEffect)(()=>{let o=n.current.config,m=f.Editor.create({...o,audioUploader:o.audioUploader?e=>n.current.config.audioUploader?.(e)??Promise.resolve(""):void 0,containerId:a,fileUploader:o.fileUploader?e=>n.current.config.fileUploader?.(e)??Promise.resolve(""):void 0,imageUploader:o.imageUploader?e=>n.current.config.imageUploader?.(e)??Promise.resolve(""):void 0,onChange:o.onChange?e=>n.current.config.onChange?.(e):void 0,onEmbedAction:o.onEmbedAction?(e,c)=>n.current.config.onEmbedAction?.(e,c):void 0,onInlineRewrite:o.onInlineRewrite?(e,c)=>n.current.config.onInlineRewrite?.(e,c)??Promise.resolve(null):void 0,onIssueAction:o.onIssueAction?(e,c)=>n.current.config.onIssueAction?.(e,c):void 0,onLocaleFallback:o.onLocaleFallback?e=>n.current.config.onLocaleFallback?.(e):void 0,onReady:o.onReady?()=>n.current.config.onReady?.():void 0,resolveIssues:o.resolveIssues?e=>n.current.config.resolveIssues?.(e)??Promise.resolve({}):void 0,resolveLink:o.resolveLink?e=>n.current.config.resolveLink?.(e)??Promise.resolve({}):void 0,videoUploader:o.videoUploader?e=>n.current.config.videoUploader?.(e)??Promise.resolve(""):void 0});return n.current.onApi?.(m),()=>f.Editor.destroy(a)},[a]),(0,p.jsx)("div",{className:i,"data-testid":l,id:a})};0&&(module.exports={ClepitEditor});
|
|
3
3
|
//# sourceMappingURL=editor.cjs.map
|
package/dist/editor.d.cts
CHANGED
|
@@ -16,7 +16,7 @@ type ClepitEditorProps = Omit<EditorConfig, 'containerId'> & {
|
|
|
16
16
|
* The editor is uncontrolled. Value fields (`initialData`, `placeholder`,
|
|
17
17
|
* labels, theming) are read once at mount; callbacks always invoke the latest
|
|
18
18
|
* prop, so a re-render never tears down editing state. StrictMode's doubled
|
|
19
|
-
* effect is safe: `Editor.create`
|
|
19
|
+
* effect is safe: `Editor.create` tears down any runtime in its container
|
|
20
20
|
* first, and the cleanup destroy is symmetric.
|
|
21
21
|
*/
|
|
22
22
|
declare const ClepitEditor: ({ className, id, onApi, testId, ...config }: ClepitEditorProps) => react.JSX.Element;
|
package/dist/editor.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ type ClepitEditorProps = Omit<EditorConfig, 'containerId'> & {
|
|
|
16
16
|
* The editor is uncontrolled. Value fields (`initialData`, `placeholder`,
|
|
17
17
|
* labels, theming) are read once at mount; callbacks always invoke the latest
|
|
18
18
|
* prop, so a re-render never tears down editing state. StrictMode's doubled
|
|
19
|
-
* effect is safe: `Editor.create`
|
|
19
|
+
* effect is safe: `Editor.create` tears down any runtime in its container
|
|
20
20
|
* first, and the cleanup destroy is symmetric.
|
|
21
21
|
*/
|
|
22
22
|
declare const ClepitEditor: ({ className, id, onApi, testId, ...config }: ClepitEditorProps) => react.JSX.Element;
|
package/dist/editor.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use client";import{Editor as
|
|
2
|
+
"use client";import{Editor as s}from"@clepit/core";import{useEffect as p,useId as g,useRef as m}from"react";import{jsx as v}from"react/jsx-runtime";var U=({className:c,id:l,onApi:d,testId:a,...t})=>{let u=g(),i=l??`clepit-editor-${u.replace(/[^a-zA-Z0-9_-]/g,"")}`,n=m({config:t,onApi:d});return n.current={config:t,onApi:d},p(()=>{let o=n.current.config,f=s.create({...o,audioUploader:o.audioUploader?e=>n.current.config.audioUploader?.(e)??Promise.resolve(""):void 0,containerId:i,fileUploader:o.fileUploader?e=>n.current.config.fileUploader?.(e)??Promise.resolve(""):void 0,imageUploader:o.imageUploader?e=>n.current.config.imageUploader?.(e)??Promise.resolve(""):void 0,onChange:o.onChange?e=>n.current.config.onChange?.(e):void 0,onEmbedAction:o.onEmbedAction?(e,r)=>n.current.config.onEmbedAction?.(e,r):void 0,onInlineRewrite:o.onInlineRewrite?(e,r)=>n.current.config.onInlineRewrite?.(e,r)??Promise.resolve(null):void 0,onIssueAction:o.onIssueAction?(e,r)=>n.current.config.onIssueAction?.(e,r):void 0,onLocaleFallback:o.onLocaleFallback?e=>n.current.config.onLocaleFallback?.(e):void 0,onReady:o.onReady?()=>n.current.config.onReady?.():void 0,resolveIssues:o.resolveIssues?e=>n.current.config.resolveIssues?.(e)??Promise.resolve({}):void 0,resolveLink:o.resolveLink?e=>n.current.config.resolveLink?.(e)??Promise.resolve({}):void 0,videoUploader:o.videoUploader?e=>n.current.config.videoUploader?.(e)??Promise.resolve(""):void 0});return n.current.onApi?.(f),()=>s.destroy(i)},[i]),v("div",{className:c,"data-testid":a,id:i})};export{U as ClepitEditor};
|
|
3
3
|
//# sourceMappingURL=editor.js.map
|
package/package.json
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"description": "React components for the Clepit block-style editor: server-first content rendering and a client-only editor component",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@bomdisoft/typescript-config": "0.0.0",
|
|
6
|
-
"@clepit/core": "0.
|
|
7
|
-
"@happy-dom/global-registrator": "^20.
|
|
8
|
-
"@testing-library/react": "^16.3.
|
|
9
|
-
"@types/bun": "^1.4.
|
|
6
|
+
"@clepit/core": "0.6.0",
|
|
7
|
+
"@happy-dom/global-registrator": "^20.14.5",
|
|
8
|
+
"@testing-library/react": "^16.3.3",
|
|
9
|
+
"@types/bun": "^1.4.2",
|
|
10
10
|
"@types/react": "^19.2.18",
|
|
11
11
|
"@types/react-dom": "^19.2.4",
|
|
12
12
|
"react": "19.2.8",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
},
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
19
20
|
"import": "./dist/index.js",
|
|
20
|
-
"require": "./dist/index.cjs"
|
|
21
|
-
"types": "./dist/index.d.ts"
|
|
21
|
+
"require": "./dist/index.cjs"
|
|
22
22
|
},
|
|
23
23
|
"./editor": {
|
|
24
|
+
"types": "./dist/editor.d.ts",
|
|
24
25
|
"import": "./dist/editor.js",
|
|
25
|
-
"require": "./dist/editor.cjs"
|
|
26
|
-
"types": "./dist/editor.d.ts"
|
|
26
|
+
"require": "./dist/editor.cjs"
|
|
27
27
|
},
|
|
28
28
|
"./package.json": "./package.json"
|
|
29
29
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"module": "./dist/index.js",
|
|
36
36
|
"name": "@clepit/react",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@clepit/core": "^0.
|
|
38
|
+
"@clepit/core": "^0.6.0",
|
|
39
39
|
"react": ">=19"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"sideEffects": false,
|
|
55
55
|
"type": "module",
|
|
56
56
|
"types": "./dist/index.d.ts",
|
|
57
|
-
"version": "0.
|
|
57
|
+
"version": "0.3.0-beta.396"
|
|
58
58
|
}
|