@caspeco/casper-ui-library 10.7.3 → 10.8.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 +1 -0
- package/dist/components/rich-text-editor/boolean-control.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor-control.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.js +1 -1
- package/dist/components/rich-text-editor/use-rich-text-editor.js +1 -1
- package/dist/components/table/table-header-dropdown.d.ts +3 -5
- package/dist/components/table/table-header-dropdown.d.ts.map +1 -1
- package/dist/components/table/table-header-dropdown.js +116 -108
- package/dist/components/table/table-header-dropdown.spec.d.ts +2 -0
- package/dist/components/table/table-header-dropdown.spec.d.ts.map +1 -0
- package/dist/components/table/table-header-row.d.ts.map +1 -1
- package/dist/components/table/table-header-row.js +0 -1
- package/dist/components/table/translations.d.ts +7 -0
- package/dist/components/table/translations.d.ts.map +1 -1
- package/dist/components/table/translations.js +12 -6
- package/dist/node_modules/@tiptap/core/dist/index.js +725 -951
- package/dist/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +37 -13
- package/dist/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +11 -0
- package/dist/node_modules/@tiptap/extension-code-block/dist/index.js +1 -3
- package/dist/node_modules/@tiptap/extension-list/dist/index.js +101 -128
- package/dist/node_modules/@tiptap/extension-paragraph/dist/index.js +3 -2
- package/dist/node_modules/@tiptap/extensions/dist/index.js +6 -7
- package/dist/{node_modules → packages/casper-ui-library/node_modules}/@tiptap/react/dist/index.js +24 -24
- package/package.json +10 -9
|
@@ -28,8 +28,9 @@ var n = " ", r = "\xA0", i = e.create({
|
|
|
28
28
|
if (!e) return "";
|
|
29
29
|
let i = Array.isArray(e.content) ? e.content : [];
|
|
30
30
|
if (i.length === 0) {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
var a, o;
|
|
32
|
+
let e = Array.isArray(r == null || (a = r.previousNode) == null ? void 0 : a.content) ? r.previousNode.content : [];
|
|
33
|
+
return (r == null || (o = r.previousNode) == null ? void 0 : o.type) === "paragraph" && e.length === 0 ? n : "";
|
|
33
34
|
}
|
|
34
35
|
return t.renderChildren(i);
|
|
35
36
|
},
|
|
@@ -387,11 +387,10 @@ i.create({
|
|
|
387
387
|
})];
|
|
388
388
|
}
|
|
389
389
|
});
|
|
390
|
-
|
|
391
|
-
function z({ types: e, node: t }) {
|
|
390
|
+
function R({ types: e, node: t }) {
|
|
392
391
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
393
392
|
}
|
|
394
|
-
var
|
|
393
|
+
var z = i.create({
|
|
395
394
|
name: "trailingNode",
|
|
396
395
|
addOptions() {
|
|
397
396
|
return {
|
|
@@ -410,7 +409,7 @@ var B = i.create({
|
|
|
410
409
|
state: {
|
|
411
410
|
init: (e, t) => {
|
|
412
411
|
let n = t.tr.doc.lastChild;
|
|
413
|
-
return !
|
|
412
|
+
return !R({
|
|
414
413
|
node: n,
|
|
415
414
|
types: i
|
|
416
415
|
});
|
|
@@ -418,7 +417,7 @@ var B = i.create({
|
|
|
418
417
|
apply: (e, t) => {
|
|
419
418
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
420
419
|
let n = e.doc.lastChild;
|
|
421
|
-
return !
|
|
420
|
+
return !R({
|
|
422
421
|
node: n,
|
|
423
422
|
types: i
|
|
424
423
|
});
|
|
@@ -426,7 +425,7 @@ var B = i.create({
|
|
|
426
425
|
}
|
|
427
426
|
})];
|
|
428
427
|
}
|
|
429
|
-
}),
|
|
428
|
+
}), B = i.create({
|
|
430
429
|
name: "undoRedo",
|
|
431
430
|
addOptions() {
|
|
432
431
|
return {
|
|
@@ -454,4 +453,4 @@ var B = i.create({
|
|
|
454
453
|
}
|
|
455
454
|
});
|
|
456
455
|
//#endregion
|
|
457
|
-
export { _ as DEFAULT_DATA_ATTRIBUTE, h as Dropcursor, g as Gapcursor, v as PLUGIN_KEY,
|
|
456
|
+
export { _ as DEFAULT_DATA_ATTRIBUTE, h as Dropcursor, g as Gapcursor, v as PLUGIN_KEY, z as TrailingNode, B as UndoRedo, M as preparePlaceholderAttribute };
|
package/dist/{node_modules → packages/casper-ui-library/node_modules}/@tiptap/react/dist/index.js
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { require_shim as e } from "
|
|
3
|
-
import { CommandManager as t, DECORATION_MANAGER_PLUGIN_KEY as n, DecorationManager as r, Editor as i, Extendable as ee, Extension as te, InputRule as ne, MappablePosition as re, Mark as ie, Node as ae, NodePos as oe, PasteRule as se, callOrReturn as ce, canInsertNode as le, combineTransactionSteps as ue, commands as de,
|
|
4
|
-
import { deepEqual as
|
|
5
|
-
import { require_with_selector as
|
|
6
|
-
import j, { createContext as M, forwardRef as
|
|
7
|
-
import { Fragment as R, jsx as z, jsxs as
|
|
8
|
-
import
|
|
9
|
-
//#region
|
|
10
|
-
var B = e(),
|
|
2
|
+
import { require_shim as e } from "../../../../../../node_modules/use-sync-external-store/shim/index.js";
|
|
3
|
+
import { CommandManager as t, DECORATION_MANAGER_PLUGIN_KEY as n, DecorationManager as r, Editor as i, Extendable as ee, Extension as te, InputRule as ne, MappablePosition as re, Mark as ie, Node as ae, NodePos as oe, PasteRule as se, callOrReturn as ce, canInsertNode as le, combineTransactionSteps as ue, commands as de, createChainableState as fe, createDocument as pe, createMappablePosition as me, createNodeFromContent as he, createStyleTag as ge, defaultBlockAt as _e, deleteProps as ve, elementFromString as ye, findChildrenInRange as be, findDuplicates as xe, findParentNode as Se, findParentNodeClosestToPos as Ce, flattenExtensions as we, fromString as a, generateHTML as o, generateJSON as s, getAttributes as c, getAttributesFromExtensions as l, getChangedRanges as u, getExtensionField as d, getHTMLFromFragment as f, getMarkAttributes as p, getMarkRange as m, getMarkType as h, getMarksBetween as g, getNodeAtPosition as _, getNodeAttributes as v, getNodeType as y, getPreviousBlockSibling as b, getRenderedAttributes as x, getSchema as S, getSchemaByResolvedExtensions as C, getSchemaTypeByName as w, getSchemaTypeNameByName as T, getSplittedAttributes as E, getText as D, getTextBetween as O, getTextContentFromNodes as k, getTextSerializersFromSchema as Te, getUpdatedPosition as Ee, injectExtensionAttributesToParseRule as De, inputRulesPlugin as Oe, isActive as ke, isAndroid as Ae, isAtEndOfNode as je, isAtStartOfNode as Me, isEmptyObject as Ne, isExtensionRulesEnabled as Pe, isFunction as Fe, isList as Ie, isMacOS as Le, isMarkActive as Re, isNodeActive as ze, isNodeEmpty as Be, isNodeSelection as Ve, isNumber as He, isPlainObject as Ue, isRegExp as We, isSafari as Ge, isTextSelection as A, isiOS as Ke, markInputRule as qe, markPasteRule as Je, mergeAttributes as Ye, mergeDeep as Xe, minMax as Ze, nodeInputRule as Qe, objectIncludes as $e, parseIndentedBlocks as et, pasteRulesPlugin as tt, removeDuplicates as nt, renderNestedMarkdownContent as rt, resolveExtensions as it, resolveFocusPosition as at, selectionToInsertionEnd as ot, sortExtensions as st, splitExtensions as ct, textblockTypeInputRule as lt, updateMarkViewAttributes as ut, wrappingInputRule as dt } from "../../../../../../node_modules/@tiptap/core/dist/index.js";
|
|
4
|
+
import { deepEqual as ft } from "../../../../../../node_modules/fast-equals/dist/es/index.js";
|
|
5
|
+
import { require_with_selector as pt } from "../../../../../../node_modules/use-sync-external-store/shim/with-selector.js";
|
|
6
|
+
import j, { createContext as M, forwardRef as mt, useContext as N, useDebugValue as P, useEffect as F, useLayoutEffect as ht, useMemo as I, useRef as gt, useState as L } from "react";
|
|
7
|
+
import { Fragment as R, jsx as z, jsxs as _t } from "react/jsx-runtime";
|
|
8
|
+
import vt from "react-dom";
|
|
9
|
+
//#region node_modules/@tiptap/react/dist/index.js
|
|
10
|
+
var B = e(), yt = pt(), bt = (...e) => (t) => {
|
|
11
11
|
e.forEach((e) => {
|
|
12
12
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
13
13
|
});
|
|
14
|
-
},
|
|
14
|
+
}, xt = ({ contentComponent: e }) => {
|
|
15
15
|
let t = (0, B.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
|
|
16
16
|
return /* @__PURE__ */ z(R, { children: Object.values(t) });
|
|
17
17
|
};
|
|
@@ -36,7 +36,7 @@ function V() {
|
|
|
36
36
|
setRenderer(e, n) {
|
|
37
37
|
t = {
|
|
38
38
|
...t,
|
|
39
|
-
[e]:
|
|
39
|
+
[e]: vt.createPortal(n.reactElement, n.element, e)
|
|
40
40
|
}, r();
|
|
41
41
|
},
|
|
42
42
|
removeRenderer(e) {
|
|
@@ -76,19 +76,19 @@ var H = class extends j.Component {
|
|
|
76
76
|
}
|
|
77
77
|
render() {
|
|
78
78
|
let { editor: e, innerRef: t, ...n } = this.props;
|
|
79
|
-
return /* @__PURE__ */
|
|
80
|
-
ref:
|
|
79
|
+
return /* @__PURE__ */ _t(R, { children: [/* @__PURE__ */ z("div", {
|
|
80
|
+
ref: bt(t, this.editorContentRef),
|
|
81
81
|
...n
|
|
82
|
-
}), e?.contentComponent && /* @__PURE__ */ z(
|
|
82
|
+
}), e?.contentComponent && /* @__PURE__ */ z(xt, { contentComponent: e.contentComponent })] });
|
|
83
83
|
}
|
|
84
|
-
},
|
|
84
|
+
}, St = mt((e, t) => {
|
|
85
85
|
let n = j.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
|
|
86
86
|
return j.createElement(H, {
|
|
87
87
|
key: n,
|
|
88
88
|
innerRef: t,
|
|
89
89
|
...e
|
|
90
90
|
});
|
|
91
|
-
}), U = j.memo(
|
|
91
|
+
}), U = j.memo(St), Ct = typeof window < "u" ? ht : F, wt = class {
|
|
92
92
|
constructor(e) {
|
|
93
93
|
this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
|
|
94
94
|
editor: e,
|
|
@@ -124,10 +124,10 @@ var H = class extends j.Component {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
function W(e) {
|
|
127
|
-
let [t] = L(() => new
|
|
128
|
-
return
|
|
127
|
+
let [t] = L(() => new wt(e.editor)), n = (0, yt.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? ft);
|
|
128
|
+
return Ct(() => t.watch(e.editor), [e.editor, t]), P(n), n;
|
|
129
129
|
}
|
|
130
|
-
var G = process.env.NODE_ENV !== "production", K = typeof window > "u",
|
|
130
|
+
var G = process.env.NODE_ENV !== "production", K = typeof window > "u", Tt = K || !!(typeof window < "u" && window.next), Et = class e {
|
|
131
131
|
constructor(e) {
|
|
132
132
|
this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
|
|
133
133
|
}
|
|
@@ -136,7 +136,7 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", Mt = K |
|
|
|
136
136
|
}
|
|
137
137
|
getInitialEditor() {
|
|
138
138
|
let e = this.options.current.immediatelyRender, t = e ?? !0;
|
|
139
|
-
return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) :
|
|
139
|
+
return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : Tt && e === void 0 && (t = !1, G && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
|
|
140
140
|
}
|
|
141
141
|
createEditor() {
|
|
142
142
|
let e = {
|
|
@@ -255,10 +255,10 @@ var G = process.env.NODE_ENV !== "production", K = typeof window > "u", Mt = K |
|
|
|
255
255
|
}, 1);
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
|
-
function
|
|
259
|
-
let n =
|
|
258
|
+
function Dt(e = {}, t = []) {
|
|
259
|
+
let n = gt(e);
|
|
260
260
|
n.current = e;
|
|
261
|
-
let [r] = L(() => new
|
|
261
|
+
let [r] = L(() => new Et(n)), i = (0, B.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
|
|
262
262
|
return P(i), F(r.onRender(t)), W({
|
|
263
263
|
editor: i,
|
|
264
264
|
selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
|
|
@@ -311,4 +311,4 @@ function $({ ...e }) {
|
|
|
311
311
|
}
|
|
312
312
|
$.displayName = "Tiptap.Content", Object.assign(Q, { Content: $ });
|
|
313
313
|
//#endregion
|
|
314
|
-
export { t as CommandManager, n as DECORATION_MANAGER_PLUGIN_KEY, r as DecorationManager, i as Editor, U as EditorContent, q as EditorContext, ee as Extendable, te as Extension, ne as InputRule, re as MappablePosition, ie as Mark, ae as Node, oe as NodePos, se as PasteRule, H as PureEditorContent, J as ReactNodeViewContext, $ as TiptapContent, X as TiptapContext, Q as TiptapWrapper, ce as callOrReturn, le as canInsertNode, ue as combineTransactionSteps, de as commands, fe as
|
|
314
|
+
export { t as CommandManager, n as DECORATION_MANAGER_PLUGIN_KEY, r as DecorationManager, i as Editor, U as EditorContent, q as EditorContext, ee as Extendable, te as Extension, ne as InputRule, re as MappablePosition, ie as Mark, ae as Node, oe as NodePos, se as PasteRule, H as PureEditorContent, J as ReactNodeViewContext, $ as TiptapContent, X as TiptapContext, Q as TiptapWrapper, ce as callOrReturn, le as canInsertNode, ue as combineTransactionSteps, de as commands, fe as createChainableState, V as createContentComponent, pe as createDocument, me as createMappablePosition, he as createNodeFromContent, ge as createStyleTag, _e as defaultBlockAt, ve as deleteProps, ye as elementFromString, be as findChildrenInRange, xe as findDuplicates, Se as findParentNode, Ce as findParentNodeClosestToPos, we as flattenExtensions, a as fromString, o as generateHTML, s as generateJSON, c as getAttributes, l as getAttributesFromExtensions, u as getChangedRanges, d as getExtensionField, f as getHTMLFromFragment, p as getMarkAttributes, m as getMarkRange, h as getMarkType, g as getMarksBetween, _ as getNodeAtPosition, v as getNodeAttributes, y as getNodeType, b as getPreviousBlockSibling, x as getRenderedAttributes, S as getSchema, C as getSchemaByResolvedExtensions, w as getSchemaTypeByName, T as getSchemaTypeNameByName, E as getSplittedAttributes, D as getText, O as getTextBetween, k as getTextContentFromNodes, Te as getTextSerializersFromSchema, Ee as getUpdatedPosition, De as injectExtensionAttributesToParseRule, Oe as inputRulesPlugin, ke as isActive, Ae as isAndroid, je as isAtEndOfNode, Me as isAtStartOfNode, Ne as isEmptyObject, Pe as isExtensionRulesEnabled, Fe as isFunction, Ie as isList, Le as isMacOS, Re as isMarkActive, ze as isNodeActive, Be as isNodeEmpty, Ve as isNodeSelection, He as isNumber, Ue as isPlainObject, We as isRegExp, Ge as isSafari, A as isTextSelection, Ke as isiOS, qe as markInputRule, Je as markPasteRule, Ye as mergeAttributes, Xe as mergeDeep, Ze as minMax, Qe as nodeInputRule, $e as objectIncludes, et as parseIndentedBlocks, tt as pasteRulesPlugin, nt as removeDuplicates, rt as renderNestedMarkdownContent, it as resolveExtensions, at as resolveFocusPosition, ot as selectionToInsertionEnd, st as sortExtensions, ct as splitExtensions, lt as textblockTypeInputRule, ut as updateMarkViewAttributes, Dt as useEditor, W as useEditorState, Y as useReactNodeView, Z as useTiptap, dt as wrappingInputRule };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caspeco/casper-ui-library",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.8.0",
|
|
4
4
|
"prettier": "@caspeco/prettier-config",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"chakra": "chakra",
|
|
36
36
|
"clean:icons": "node ./scripts/clean-icons.js",
|
|
37
37
|
"generate:icons": "node ./scripts/generate-icons.js",
|
|
38
|
-
"knip": "knip"
|
|
38
|
+
"knip": "knip",
|
|
39
|
+
"test:all": "npm run prettier && npm run lint && npm run tsc && npm run knip && npm run test"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
42
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -44,10 +45,10 @@
|
|
|
44
45
|
"@caspeco/prettier-config": "^1.0.7",
|
|
45
46
|
"@chakra-ui/cli": "^3.36.1",
|
|
46
47
|
"@rolldown/plugin-babel": "^0.2.3",
|
|
47
|
-
"@types/node": "^26.
|
|
48
|
+
"@types/node": "^26.3.0",
|
|
48
49
|
"@types/react": "^19.2.18",
|
|
49
50
|
"@types/react-dom": "^19.2.4",
|
|
50
|
-
"@vitejs/plugin-react": "^6.0
|
|
51
|
+
"@vitejs/plugin-react": "^6.1.0",
|
|
51
52
|
"@vitest/browser": "^4.1.11",
|
|
52
53
|
"@vitest/browser-playwright": "^4.1.11",
|
|
53
54
|
"@vitest/ui": "^4.1.11",
|
|
@@ -81,11 +82,11 @@
|
|
|
81
82
|
"@floating-ui/dom": "^1.8.0",
|
|
82
83
|
"@tanstack/react-table": "^8.21.3",
|
|
83
84
|
"@tanstack/react-virtual": "^3.14.10",
|
|
84
|
-
"@tiptap/core": "^3.30.
|
|
85
|
-
"@tiptap/extension-link": "^3.30.
|
|
86
|
-
"@tiptap/extension-underline": "^3.30.
|
|
87
|
-
"@tiptap/react": "^3.30.
|
|
88
|
-
"@tiptap/starter-kit": "^3.30.
|
|
85
|
+
"@tiptap/core": "^3.30.5",
|
|
86
|
+
"@tiptap/extension-link": "^3.30.5",
|
|
87
|
+
"@tiptap/extension-underline": "^3.30.5",
|
|
88
|
+
"@tiptap/react": "^3.30.5",
|
|
89
|
+
"@tiptap/starter-kit": "^3.30.5",
|
|
89
90
|
"country-flag-icons": "^1.6.20",
|
|
90
91
|
"csstype": "^3.2.3",
|
|
91
92
|
"date-fns": "^4.4.0",
|