ckeditor5-phoenix 1.24.0 → 1.24.1
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/hooks/context/context.d.ts +1 -1
- package/dist/hooks/context/context.d.ts.map +1 -1
- package/dist/hooks/editable.d.ts +1 -1
- package/dist/hooks/editable.d.ts.map +1 -1
- package/dist/hooks/editor/editor.d.ts +1 -1
- package/dist/hooks/editor/editor.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/ui-part.d.ts +1 -1
- package/dist/hooks/ui-part.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/hooks/editable.test.ts +3 -3
- package/src/hooks/editor/editor.test.ts +3 -3
- package/src/shared/hook.test.ts +4 -4
|
@@ -6,5 +6,5 @@ export declare function getNearestContextParentPromise(el: HTMLElement): Promise
|
|
|
6
6
|
/**
|
|
7
7
|
* Phoenix LiveView hook for CKEditor 5 context elements.
|
|
8
8
|
*/
|
|
9
|
-
export declare const ContextHook: import('../../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
9
|
+
export declare const ContextHook: import('../../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
10
10
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/hooks/context/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAoJ1D;;GAEG;AACH,wBAAsB,8BAA8B,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAQ9G;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/hooks/context/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAoJ1D;;GAEG;AACH,wBAAsB,8BAA8B,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,CAQ9G;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,+GAA4B,CAAC"}
|
package/dist/hooks/editable.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Phoenix LiveView hook for CKEditor 5 editable elements.
|
|
3
3
|
*/
|
|
4
|
-
export declare const EditableHook: import('../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
4
|
+
export declare const EditableHook: import('../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
5
5
|
//# sourceMappingURL=editable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../../src/hooks/editable.ts"],"names":[],"mappings":"AAiIA;;GAEG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"editable.d.ts","sourceRoot":"","sources":["../../src/hooks/editable.ts"],"names":[],"mappings":"AAiIA;;GAEG;AACH,eAAO,MAAM,YAAY,4GAA6B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Phoenix LiveView hook for CKEditor 5.
|
|
3
3
|
*/
|
|
4
|
-
export declare const EditorHook: import('../../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
4
|
+
export declare const EditorHook: import('../../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
5
5
|
//# sourceMappingURL=editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/hooks/editor/editor.ts"],"names":[],"mappings":"AAiWA;;GAEG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/hooks/editor/editor.ts"],"names":[],"mappings":"AAiWA;;GAEG;AACH,eAAO,MAAM,UAAU,+GAA2B,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const Hooks: {
|
|
2
|
-
CKEditor5: import('../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
3
|
-
CKEditable: import('../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
4
|
-
CKUIPart: import('../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
5
|
-
CKContext: import('../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
2
|
+
CKEditor5: import('../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
3
|
+
CKEditable: import('../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
4
|
+
CKUIPart: import('../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
5
|
+
CKContext: import('../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/hooks/ui-part.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Phoenix LiveView hook for CKEditor 5 UI parts.
|
|
3
3
|
*/
|
|
4
|
-
export declare const UIPartHook: import('../types').RequiredBy<import('phoenix_live_view').Hook<any>, "mounted" | "destroyed">;
|
|
4
|
+
export declare const UIPartHook: import('../types').RequiredBy<import('phoenix_live_view').Hook<any, HTMLElement>, "mounted" | "destroyed">;
|
|
5
5
|
//# sourceMappingURL=ui-part.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-part.d.ts","sourceRoot":"","sources":["../../src/hooks/ui-part.ts"],"names":[],"mappings":"AA0FA;;GAEG;AACH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"ui-part.d.ts","sourceRoot":"","sources":["../../src/hooks/ui-part.ts"],"names":[],"mappings":"AA0FA;;GAEG;AACH,eAAO,MAAM,UAAU,4GAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -248,7 +248,7 @@ describe('editable hook', () => {
|
|
|
248
248
|
});
|
|
249
249
|
|
|
250
250
|
editable.setAttribute('data-cke-editable-initial-value', '<p>Updated</p>');
|
|
251
|
-
EditableHook
|
|
251
|
+
EditableHook['updated']!.call({ el: editable });
|
|
252
252
|
|
|
253
253
|
await vi.waitFor(() => {
|
|
254
254
|
expect(editor.getData({ rootName: 'foo' })).toBe('<p>Updated</p>');
|
|
@@ -272,7 +272,7 @@ describe('editable hook', () => {
|
|
|
272
272
|
const setDataSpy = vi.spyOn(editor, 'setData');
|
|
273
273
|
|
|
274
274
|
editable.setAttribute('data-cke-editable-initial-value', '<p>Same</p>');
|
|
275
|
-
EditableHook
|
|
275
|
+
EditableHook['updated']!.call({ el: editable });
|
|
276
276
|
|
|
277
277
|
await timeout(50);
|
|
278
278
|
|
|
@@ -294,7 +294,7 @@ describe('editable hook', () => {
|
|
|
294
294
|
});
|
|
295
295
|
|
|
296
296
|
editable.setAttribute('data-cke-editable-root-attrs', JSON.stringify({ 'data-lang': 'pl' }));
|
|
297
|
-
EditableHook
|
|
297
|
+
EditableHook['updated']!.call({ el: editable });
|
|
298
298
|
|
|
299
299
|
await vi.waitFor(() => {
|
|
300
300
|
const root = editor.model.document.getRoot('foo')!;
|
|
@@ -378,7 +378,7 @@ describe('editor hook', () => {
|
|
|
378
378
|
const editor = await waitForTestEditor();
|
|
379
379
|
|
|
380
380
|
hookElement.setAttribute('data-cke-initial-value', '<p>Updated</p>');
|
|
381
|
-
EditorHook
|
|
381
|
+
EditorHook['updated']!.call({ el: hookElement });
|
|
382
382
|
|
|
383
383
|
await vi.waitFor(() => {
|
|
384
384
|
expect(editor.getData()).toBe('<p>Updated</p>');
|
|
@@ -397,7 +397,7 @@ describe('editor hook', () => {
|
|
|
397
397
|
const editor = await waitForTestEditor();
|
|
398
398
|
|
|
399
399
|
hookElement.setAttribute('data-cke-initial-value', '<p>Updated</p>');
|
|
400
|
-
EditorHook
|
|
400
|
+
EditorHook['updated']!.call({ el: hookElement });
|
|
401
401
|
|
|
402
402
|
await vi.waitFor(() => {
|
|
403
403
|
expect(editor.getData()).toBe('<p>Updated</p>');
|
|
@@ -416,7 +416,7 @@ describe('editor hook', () => {
|
|
|
416
416
|
const setDataSpy = vi.spyOn(editor, 'setData');
|
|
417
417
|
|
|
418
418
|
hookElement.setAttribute('data-cke-initial-value', '<p>Same</p>');
|
|
419
|
-
EditorHook
|
|
419
|
+
EditorHook['updated']!.call({ el: hookElement });
|
|
420
420
|
|
|
421
421
|
await vi.waitFor(() => {
|
|
422
422
|
expect(setDataSpy).not.toHaveBeenCalled();
|
package/src/shared/hook.test.ts
CHANGED
|
@@ -146,10 +146,10 @@ describe('makeHook', () => {
|
|
|
146
146
|
|
|
147
147
|
await expect(hookObj.mounted.call(mockContext)).resolves.not.toThrow();
|
|
148
148
|
|
|
149
|
-
expect(() => hookObj
|
|
150
|
-
expect(() => hookObj
|
|
151
|
-
expect(() => hookObj
|
|
152
|
-
expect(() => hookObj
|
|
149
|
+
expect(() => hookObj['beforeUpdate']?.call(mockContext)).not.toThrow();
|
|
150
|
+
expect(() => hookObj['updated']?.call(mockContext)).not.toThrow();
|
|
151
|
+
expect(() => hookObj['disconnected']?.call(mockContext)).not.toThrow();
|
|
152
|
+
expect(() => hookObj['reconnected']?.call(mockContext)).not.toThrow();
|
|
153
153
|
|
|
154
154
|
await expect(hookObj.destroyed.call(mockContext)).resolves.not.toThrow();
|
|
155
155
|
});
|