@codella-software/react 2.1.0 → 2.2.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/dist/index.cjs +777 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +778 -1
- package/dist/index.mjs.map +1 -1
- package/dist/react/src/index.d.ts +1 -0
- package/dist/react/src/index.d.ts.map +1 -1
- package/dist/react/src/rich-content/index.d.ts +5 -0
- package/dist/react/src/rich-content/index.d.ts.map +1 -0
- package/dist/react/src/rich-content/useRichContent.d.ts +70 -0
- package/dist/react/src/rich-content/useRichContent.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
export { useFiltersAndSort, type UseFiltersAndSortOptions, type UseFiltersAndSortReturn } from './filters-and-sort';
|
|
42
42
|
export { useFormBuilder, type UseFormBuilderOptions, type UseFormBuilderReturn } from './form-builder';
|
|
43
43
|
export * from './live-updates';
|
|
44
|
+
export * from './rich-content';
|
|
44
45
|
export { useTableService, type UseTableServiceOptions, type UseTableServiceReturn } from './table-builder';
|
|
45
46
|
export * from './tabs';
|
|
46
47
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AACnH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACtG,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC1G,cAAc,QAAQ,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AACnH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AACtG,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,eAAe,EAAE,KAAK,sBAAsB,EAAE,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAC1G,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rich-content/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ContentEditableAdapter, DocumentNode, MarkType, RichContentConfig, RichContentService, RichContentState, Selection } from '../../../core/src/rich-content';
|
|
2
|
+
/**
|
|
3
|
+
* Hook options for useRichContent
|
|
4
|
+
*/
|
|
5
|
+
export interface UseRichContentOptions extends RichContentConfig {
|
|
6
|
+
/** DOM element ref for contentEditable */
|
|
7
|
+
editorRef?: React.RefObject<HTMLElement>;
|
|
8
|
+
/** Custom adapter instance */
|
|
9
|
+
adapter?: ContentEditableAdapter;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Hook return value for useRichContent
|
|
13
|
+
*/
|
|
14
|
+
export interface UseRichContentReturn {
|
|
15
|
+
/** Service instance */
|
|
16
|
+
service: RichContentService;
|
|
17
|
+
/** Current document content */
|
|
18
|
+
content: DocumentNode;
|
|
19
|
+
/** Full state object */
|
|
20
|
+
state: RichContentState;
|
|
21
|
+
/** Current editor focus state */
|
|
22
|
+
isFocused: boolean;
|
|
23
|
+
/** Can undo */
|
|
24
|
+
canUndo: boolean;
|
|
25
|
+
/** Can redo */
|
|
26
|
+
canRedo: boolean;
|
|
27
|
+
/** Active mark types */
|
|
28
|
+
selectedFormats: Set<MarkType>;
|
|
29
|
+
/** Current selection */
|
|
30
|
+
selection: Selection | null;
|
|
31
|
+
/** Is dirty (has unsaved changes) */
|
|
32
|
+
isDirty: boolean;
|
|
33
|
+
/** Insert text */
|
|
34
|
+
insertText: (text: string) => void;
|
|
35
|
+
/** Insert paragraph */
|
|
36
|
+
insertParagraph: () => void;
|
|
37
|
+
/** Insert heading */
|
|
38
|
+
insertHeading: (level: 1 | 2 | 3 | 4 | 5 | 6) => void;
|
|
39
|
+
/** Insert image */
|
|
40
|
+
insertImage: (url: string) => void;
|
|
41
|
+
/** Upload image file */
|
|
42
|
+
uploadImage: (file: File) => Promise<void>;
|
|
43
|
+
/** Insert mention */
|
|
44
|
+
insertMention: (id: string, label: string) => void;
|
|
45
|
+
/** Insert list */
|
|
46
|
+
insertList: (type: 'ordered' | 'unordered') => void;
|
|
47
|
+
/** Toggle mark */
|
|
48
|
+
toggleMark: (mark: MarkType) => void;
|
|
49
|
+
/** Delete content */
|
|
50
|
+
deleteContent: () => void;
|
|
51
|
+
/** Undo */
|
|
52
|
+
undo: () => void;
|
|
53
|
+
/** Redo */
|
|
54
|
+
redo: () => void;
|
|
55
|
+
/** Clear history */
|
|
56
|
+
clearHistory: () => void;
|
|
57
|
+
/** Focus editor */
|
|
58
|
+
focus: () => void;
|
|
59
|
+
/** Set focus state */
|
|
60
|
+
setFocus: (focused: boolean) => void;
|
|
61
|
+
/** Get plain text */
|
|
62
|
+
getPlainText: () => string;
|
|
63
|
+
/** Set selection */
|
|
64
|
+
setSelection: (selection: Selection | null) => void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* React hook that wraps RichContentService and manages state subscriptions
|
|
68
|
+
*/
|
|
69
|
+
export declare function useRichContent(options?: UseRichContentOptions): UseRichContentReturn;
|
|
70
|
+
//# sourceMappingURL=useRichContent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRichContent.d.ts","sourceRoot":"","sources":["../../../../src/rich-content/useRichContent.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACV,MAAM,4BAA4B,CAAC;AAGpC;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,0CAA0C;IAC1C,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACzC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,sBAAsB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uBAAuB;IACvB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,+BAA+B;IAC/B,OAAO,EAAE,YAAY,CAAC;IACtB,wBAAwB;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,iCAAiC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,wBAAwB;IACxB,eAAe,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/B,wBAAwB;IACxB,SAAS,EAAE,SAAS,GAAG,IAAI,CAAC;IAC5B,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IAGjB,kBAAkB;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,uBAAuB;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,qBAAqB;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACtD,mBAAmB;IACnB,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,wBAAwB;IACxB,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,qBAAqB;IACrB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,kBAAkB;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,KAAK,IAAI,CAAC;IACpD,kBAAkB;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,qBAAqB;IACrB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,WAAW;IACX,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,WAAW;IACX,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,oBAAoB;IACpB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,sBAAsB;IACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,qBAAqB;IACrB,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,oBAAoB;IACpB,YAAY,EAAE,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,oBAAoB,CAsGxF"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codella-software/react",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "React hooks for Codella core services",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "React hooks for Codella core services (FormBuilder, TableBuilder, FiltersAndSort, RichContent)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"form-builder",
|
|
7
7
|
"table-builder",
|