@measured/puck 0.21.0-canary.eb8ea5ce → 0.21.0-canary.ece26d91
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-DR57V55X.mjs → Editor-O447AVCX.mjs} +17 -7
- package/dist/{Render-6Q5WP25Y.mjs → Render-OFE6QLI2.mjs} +8 -4
- package/dist/{walk-tree-Ja9bNCM9.d.mts → actions-ONhOkrvf.d.mts} +1 -27
- package/dist/{walk-tree-Ja9bNCM9.d.ts → actions-ONhOkrvf.d.ts} +1 -27
- package/dist/chunk-2Q4PACDA.mjs +111 -0
- package/dist/chunk-62AAYNXG.mjs +63 -0
- package/dist/chunk-BSDEIOEK.mjs +706 -0
- package/dist/chunk-CSSRLPHM.mjs +11 -0
- package/dist/{chunk-OPXWLTPM.mjs → chunk-DAQLMM2T.mjs} +1377 -2795
- package/dist/chunk-M6W7YEVX.mjs +95 -0
- package/dist/{chunk-YZQENDBP.mjs → chunk-NLUHDYVR.mjs} +2 -123
- package/dist/chunk-PLXSMBAA.mjs +53 -0
- package/dist/chunk-QAWJTCV5.mjs +33 -0
- package/dist/chunk-QBGM4ELA.mjs +528 -0
- package/dist/{chunk-MSIUWPEI.mjs → chunk-QBJ2LDJB.mjs} +36 -20
- package/dist/chunk-T3WX7XJ6.mjs +132 -0
- package/dist/{chunk-CF5XA6LF.mjs → chunk-V5I7CVLT.mjs} +1 -1
- package/dist/chunk-Y2EFNT5P.mjs +108 -0
- package/dist/{chunk-A7EMVTSK.mjs → chunk-Y656T6AQ.mjs} +13 -7
- package/dist/full-2GJTAAZE.css +301 -0
- package/dist/full-BEMDJKDS.mjs +93 -0
- package/dist/index-BEoNHRI1.d.ts +116 -0
- package/dist/index-DfxZ7tZF.d.mts +116 -0
- package/dist/index.d.mts +9 -125
- package/dist/index.d.ts +9 -125
- package/dist/index.js +1002 -775
- package/dist/index.mjs +14 -5
- package/dist/internal.d.mts +27 -0
- package/dist/internal.d.ts +27 -0
- package/dist/internal.js +908 -0
- package/dist/internal.mjs +13 -0
- package/dist/loaded-JU3A7Y4L.mjs +57 -0
- package/dist/loaded-N3FYGF2Y.mjs +57 -0
- package/dist/loaded-OBY7OMS6.mjs +60 -0
- package/dist/loaded-RVWBFK7L.css +87 -0
- package/dist/no-external.d.mts +3 -1
- package/dist/no-external.d.ts +3 -1
- package/dist/no-external.js +1002 -775
- package/dist/no-external.mjs +14 -5
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/dist/rsc.mjs +6 -3
- package/dist/walk-tree-CdriEzFJ.d.mts +29 -0
- package/dist/walk-tree-DHbAZ4wF.d.ts +29 -0
- package/package.json +7 -2
- package/dist/chunk-GQ457KMA.mjs +0 -199
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mapFields
|
|
3
|
+
} from "./chunk-NLUHDYVR.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__async,
|
|
6
|
+
__spreadProps,
|
|
7
|
+
__spreadValues,
|
|
8
|
+
init_react_import
|
|
9
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
10
|
+
|
|
11
|
+
// components/ViewportControls/default-viewports.ts
|
|
12
|
+
init_react_import();
|
|
13
|
+
var defaultViewports = [
|
|
14
|
+
{ width: 360, height: "auto", icon: "Smartphone", label: "Small" },
|
|
15
|
+
{ width: 768, height: "auto", icon: "Tablet", label: "Medium" },
|
|
16
|
+
{ width: 1280, height: "auto", icon: "Monitor", label: "Large" }
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
// lib/resolve-component-data.ts
|
|
20
|
+
init_react_import();
|
|
21
|
+
|
|
22
|
+
// lib/get-changed.ts
|
|
23
|
+
init_react_import();
|
|
24
|
+
import { deepEqual } from "fast-equals";
|
|
25
|
+
var getChanged = (newItem, oldItem) => {
|
|
26
|
+
return newItem ? Object.keys(newItem.props || {}).reduce((acc, item) => {
|
|
27
|
+
const newItemProps = (newItem == null ? void 0 : newItem.props) || {};
|
|
28
|
+
const oldItemProps = (oldItem == null ? void 0 : oldItem.props) || {};
|
|
29
|
+
return __spreadProps(__spreadValues({}, acc), {
|
|
30
|
+
[item]: !deepEqual(oldItemProps[item], newItemProps[item])
|
|
31
|
+
});
|
|
32
|
+
}, {}) : {};
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// lib/resolve-component-data.ts
|
|
36
|
+
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
37
|
+
var cache = { lastChange: {} };
|
|
38
|
+
var resolveComponentData = (_0, _1, ..._2) => __async(null, [_0, _1, ..._2], function* (item, config, metadata = {}, onResolveStart, onResolveEnd, trigger = "replace") {
|
|
39
|
+
const configForItem = "type" in item && item.type !== "root" ? config.components[item.type] : config.root;
|
|
40
|
+
const resolvedItem = __spreadValues({}, item);
|
|
41
|
+
const shouldRunResolver = (configForItem == null ? void 0 : configForItem.resolveData) && item.props;
|
|
42
|
+
const id = "id" in item.props ? item.props.id : "root";
|
|
43
|
+
if (shouldRunResolver) {
|
|
44
|
+
const { item: oldItem = null, resolved = {} } = cache.lastChange[id] || {};
|
|
45
|
+
if (trigger !== "force" && item && deepEqual2(item, oldItem)) {
|
|
46
|
+
return { node: resolved, didChange: false };
|
|
47
|
+
}
|
|
48
|
+
const changed = getChanged(item, oldItem);
|
|
49
|
+
if (onResolveStart) {
|
|
50
|
+
onResolveStart(item);
|
|
51
|
+
}
|
|
52
|
+
const { props: resolvedProps, readOnly = {} } = yield configForItem.resolveData(item, {
|
|
53
|
+
changed,
|
|
54
|
+
lastData: oldItem,
|
|
55
|
+
metadata: __spreadValues(__spreadValues({}, metadata), configForItem.metadata),
|
|
56
|
+
trigger
|
|
57
|
+
});
|
|
58
|
+
resolvedItem.props = __spreadValues(__spreadValues({}, item.props), resolvedProps);
|
|
59
|
+
if (Object.keys(readOnly).length) {
|
|
60
|
+
resolvedItem.readOnly = readOnly;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
let itemWithResolvedChildren = yield mapFields(
|
|
64
|
+
resolvedItem,
|
|
65
|
+
{
|
|
66
|
+
slot: (_02) => __async(null, [_02], function* ({ value }) {
|
|
67
|
+
const content = value;
|
|
68
|
+
return yield Promise.all(
|
|
69
|
+
content.map(
|
|
70
|
+
(childItem) => __async(null, null, function* () {
|
|
71
|
+
return (yield resolveComponentData(
|
|
72
|
+
childItem,
|
|
73
|
+
config,
|
|
74
|
+
metadata,
|
|
75
|
+
onResolveStart,
|
|
76
|
+
onResolveEnd,
|
|
77
|
+
trigger
|
|
78
|
+
)).node;
|
|
79
|
+
})
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
})
|
|
83
|
+
},
|
|
84
|
+
config
|
|
85
|
+
);
|
|
86
|
+
if (shouldRunResolver && onResolveEnd) {
|
|
87
|
+
onResolveEnd(resolvedItem);
|
|
88
|
+
}
|
|
89
|
+
cache.lastChange[id] = {
|
|
90
|
+
item,
|
|
91
|
+
resolved: itemWithResolvedChildren
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
node: itemWithResolvedChildren,
|
|
95
|
+
didChange: !deepEqual2(item, itemWithResolvedChildren)
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// store/default-app-state.ts
|
|
100
|
+
init_react_import();
|
|
101
|
+
var defaultAppState = {
|
|
102
|
+
data: { content: [], root: {}, zones: {} },
|
|
103
|
+
ui: {
|
|
104
|
+
leftSideBarVisible: true,
|
|
105
|
+
rightSideBarVisible: true,
|
|
106
|
+
arrayState: {},
|
|
107
|
+
itemSelector: null,
|
|
108
|
+
componentList: {},
|
|
109
|
+
isDragging: false,
|
|
110
|
+
previewMode: "edit",
|
|
111
|
+
viewports: {
|
|
112
|
+
current: {
|
|
113
|
+
width: defaultViewports[0].width,
|
|
114
|
+
height: defaultViewports[0].height || "auto"
|
|
115
|
+
},
|
|
116
|
+
options: [],
|
|
117
|
+
controlsVisible: true
|
|
118
|
+
},
|
|
119
|
+
field: { focus: null }
|
|
120
|
+
},
|
|
121
|
+
indexes: {
|
|
122
|
+
nodes: {},
|
|
123
|
+
zones: {}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export {
|
|
128
|
+
defaultViewports,
|
|
129
|
+
getChanged,
|
|
130
|
+
resolveComponentData,
|
|
131
|
+
defaultAppState
|
|
132
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__spreadValues,
|
|
4
|
+
__toESM,
|
|
5
|
+
init_react_import
|
|
6
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
7
|
+
|
|
8
|
+
// ../../node_modules/classnames/index.js
|
|
9
|
+
var require_classnames = __commonJS({
|
|
10
|
+
"../../node_modules/classnames/index.js"(exports, module) {
|
|
11
|
+
"use strict";
|
|
12
|
+
init_react_import();
|
|
13
|
+
(function() {
|
|
14
|
+
"use strict";
|
|
15
|
+
var hasOwn = {}.hasOwnProperty;
|
|
16
|
+
function classNames() {
|
|
17
|
+
var classes = "";
|
|
18
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
19
|
+
var arg = arguments[i];
|
|
20
|
+
if (arg) {
|
|
21
|
+
classes = appendClass(classes, parseValue(arg));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return classes;
|
|
25
|
+
}
|
|
26
|
+
function parseValue(arg) {
|
|
27
|
+
if (typeof arg === "string" || typeof arg === "number") {
|
|
28
|
+
return arg;
|
|
29
|
+
}
|
|
30
|
+
if (typeof arg !== "object") {
|
|
31
|
+
return "";
|
|
32
|
+
}
|
|
33
|
+
if (Array.isArray(arg)) {
|
|
34
|
+
return classNames.apply(null, arg);
|
|
35
|
+
}
|
|
36
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
37
|
+
return arg.toString();
|
|
38
|
+
}
|
|
39
|
+
var classes = "";
|
|
40
|
+
for (var key in arg) {
|
|
41
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
42
|
+
classes = appendClass(classes, key);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return classes;
|
|
46
|
+
}
|
|
47
|
+
function appendClass(value, newClass) {
|
|
48
|
+
if (!newClass) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
if (value) {
|
|
52
|
+
return value + " " + newClass;
|
|
53
|
+
}
|
|
54
|
+
return value + newClass;
|
|
55
|
+
}
|
|
56
|
+
if (typeof module !== "undefined" && module.exports) {
|
|
57
|
+
classNames.default = classNames;
|
|
58
|
+
module.exports = classNames;
|
|
59
|
+
} else if (typeof define === "function" && typeof define.amd === "object" && define.amd) {
|
|
60
|
+
define("classnames", [], function() {
|
|
61
|
+
return classNames;
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
window.classNames = classNames;
|
|
65
|
+
}
|
|
66
|
+
})();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// lib/get-class-name-factory.ts
|
|
71
|
+
init_react_import();
|
|
72
|
+
var import_classnames = __toESM(require_classnames());
|
|
73
|
+
var getClassNameFactory = (rootClass, styles, config = { baseClass: "" }) => (options = {}) => {
|
|
74
|
+
if (typeof options === "string") {
|
|
75
|
+
const descendant = options;
|
|
76
|
+
const style = styles[`${rootClass}-${descendant}`];
|
|
77
|
+
if (style) {
|
|
78
|
+
return config.baseClass + styles[`${rootClass}-${descendant}`] || "";
|
|
79
|
+
}
|
|
80
|
+
return "";
|
|
81
|
+
} else if (typeof options === "object") {
|
|
82
|
+
const modifiers = options;
|
|
83
|
+
const prefixedModifiers = {};
|
|
84
|
+
for (let modifier in modifiers) {
|
|
85
|
+
prefixedModifiers[styles[`${rootClass}--${modifier}`]] = modifiers[modifier];
|
|
86
|
+
}
|
|
87
|
+
const c = styles[rootClass];
|
|
88
|
+
return config.baseClass + (0, import_classnames.default)(__spreadValues({
|
|
89
|
+
[c]: !!c
|
|
90
|
+
}, prefixedModifiers));
|
|
91
|
+
} else {
|
|
92
|
+
return config.baseClass + styles[rootClass] || "";
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
var get_class_name_factory_default = getClassNameFactory;
|
|
96
|
+
|
|
97
|
+
export {
|
|
98
|
+
get_class_name_factory_default
|
|
99
|
+
};
|
|
100
|
+
/*! Bundled license information:
|
|
101
|
+
|
|
102
|
+
classnames/index.js:
|
|
103
|
+
(*!
|
|
104
|
+
Copyright (c) 2018 Jed Watson.
|
|
105
|
+
Licensed under the MIT License (MIT), see
|
|
106
|
+
http://jedwatson.github.io/classnames
|
|
107
|
+
*)
|
|
108
|
+
*/
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
styles_module_default
|
|
3
|
+
} from "./chunk-CSSRLPHM.mjs";
|
|
1
4
|
import {
|
|
2
5
|
defaultAppState,
|
|
6
|
+
resolveComponentData
|
|
7
|
+
} from "./chunk-T3WX7XJ6.mjs";
|
|
8
|
+
import {
|
|
9
|
+
get_class_name_factory_default
|
|
10
|
+
} from "./chunk-Y2EFNT5P.mjs";
|
|
11
|
+
import {
|
|
3
12
|
mapFields,
|
|
4
|
-
resolveComponentData,
|
|
5
13
|
walkAppState,
|
|
6
14
|
walkTree
|
|
7
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NLUHDYVR.mjs";
|
|
8
16
|
import {
|
|
9
17
|
__async,
|
|
10
18
|
__objRest,
|
|
11
19
|
__spreadProps,
|
|
12
20
|
__spreadValues,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
styles_module_default
|
|
16
|
-
} from "./chunk-GQ457KMA.mjs";
|
|
21
|
+
init_react_import
|
|
22
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
17
23
|
|
|
18
24
|
// lib/migrate.ts
|
|
19
25
|
init_react_import();
|
|
@@ -338,7 +344,7 @@ function useRichtextProps(fields, props) {
|
|
|
338
344
|
const richtextProps = useMemo2(() => {
|
|
339
345
|
if (!(richtextKeys == null ? void 0 : richtextKeys.length)) return {};
|
|
340
346
|
const RichTextRender = lazy(
|
|
341
|
-
() => import("./Render-
|
|
347
|
+
() => import("./Render-OFE6QLI2.mjs").then((m) => ({
|
|
342
348
|
default: m.RichTextRender
|
|
343
349
|
}))
|
|
344
350
|
);
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/styles.module.css/#css-module-data */
|
|
2
|
+
._RichTextMenu_k97eh_1 {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
flex-wrap: nowrap;
|
|
6
|
+
}
|
|
7
|
+
._RichTextMenu--form_k97eh_7 {
|
|
8
|
+
border-top-left-radius: 4px;
|
|
9
|
+
border-top-right-radius: 4px;
|
|
10
|
+
padding: 6px 6px;
|
|
11
|
+
background-color: var(--puck-color-grey-12);
|
|
12
|
+
position: relative;
|
|
13
|
+
scrollbar-width: none;
|
|
14
|
+
overflow-x: auto;
|
|
15
|
+
}
|
|
16
|
+
._RichTextMenu-group_k97eh_17 {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: space-between;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
flex-wrap: nowrap;
|
|
21
|
+
padding-inline: 6px;
|
|
22
|
+
gap: 2px;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
._RichTextMenu-group_k97eh_17:first-of-type {
|
|
26
|
+
padding-left: 0;
|
|
27
|
+
}
|
|
28
|
+
._RichTextMenu-group_k97eh_17:last-of-type {
|
|
29
|
+
padding-right: 0;
|
|
30
|
+
}
|
|
31
|
+
._RichTextMenu--inline_k97eh_35 ._RichTextMenu-group_k97eh_17 {
|
|
32
|
+
color: var(--puck-color-grey-08);
|
|
33
|
+
gap: 0px;
|
|
34
|
+
flex-wrap: nowrap;
|
|
35
|
+
}
|
|
36
|
+
._RichTextMenu-group_k97eh_17 + ._RichTextMenu-group_k97eh_17 {
|
|
37
|
+
border-left: 1px solid var(--puck-color-grey-10);
|
|
38
|
+
}
|
|
39
|
+
._RichTextMenu--inline_k97eh_35 ._RichTextMenu-group_k97eh_17 + ._RichTextMenu-group_k97eh_17 {
|
|
40
|
+
border-left: 0.5px solid var(--puck-color-grey-05);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/IconButton/IconButton.module.css/#css-module-data */
|
|
44
|
+
._IconButton_ffob9_1 {
|
|
45
|
+
align-items: center;
|
|
46
|
+
background: transparent;
|
|
47
|
+
border: none;
|
|
48
|
+
border-radius: 4px;
|
|
49
|
+
color: currentColor;
|
|
50
|
+
display: flex;
|
|
51
|
+
font-family: var(--puck-font-family);
|
|
52
|
+
justify-content: center;
|
|
53
|
+
padding: 4px;
|
|
54
|
+
transition: background-color 50ms ease-in, color 50ms ease-in;
|
|
55
|
+
}
|
|
56
|
+
._IconButton--active_ffob9_14 {
|
|
57
|
+
color: var(--puck-color-azure-04);
|
|
58
|
+
}
|
|
59
|
+
._IconButton_ffob9_1:focus-visible {
|
|
60
|
+
outline: 2px solid var(--puck-color-azure-05);
|
|
61
|
+
outline-offset: -2px;
|
|
62
|
+
}
|
|
63
|
+
@media (hover: hover) and (pointer: fine) {
|
|
64
|
+
._IconButton_ffob9_1:hover:not(._IconButton--disabled_ffob9_24) {
|
|
65
|
+
background: var(--puck-color-grey-10);
|
|
66
|
+
color: var(--puck-color-azure-04);
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
transition: none;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
._IconButton_ffob9_1:active {
|
|
72
|
+
background: var(--puck-color-azure-11);
|
|
73
|
+
transition: none;
|
|
74
|
+
}
|
|
75
|
+
._IconButton-title_ffob9_37 {
|
|
76
|
+
clip: rect(0 0 0 0);
|
|
77
|
+
clip-path: inset(100%);
|
|
78
|
+
height: 1px;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
position: absolute;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
width: 1px;
|
|
83
|
+
}
|
|
84
|
+
._IconButton--disabled_ffob9_24 {
|
|
85
|
+
color: var(--puck-color-grey-07);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Loader/styles.module.css/#css-module-data */
|
|
89
|
+
@keyframes _loader-animation_nacdm_1 {
|
|
90
|
+
0% {
|
|
91
|
+
transform: rotate(0deg) scale(1);
|
|
92
|
+
}
|
|
93
|
+
50% {
|
|
94
|
+
transform: rotate(180deg) scale(0.8);
|
|
95
|
+
}
|
|
96
|
+
100% {
|
|
97
|
+
transform: rotate(360deg) scale(1);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
._Loader_nacdm_13 {
|
|
101
|
+
background: transparent;
|
|
102
|
+
border-radius: 100%;
|
|
103
|
+
border: 2px solid currentColor;
|
|
104
|
+
border-bottom-color: transparent;
|
|
105
|
+
display: inline-block;
|
|
106
|
+
animation: _loader-animation_nacdm_1 1s 0s infinite linear;
|
|
107
|
+
animation-fill-mode: both;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/ActionBar/styles.module.css/#css-module-data */
|
|
111
|
+
._ActionBar_1nmyk_1 {
|
|
112
|
+
align-items: center;
|
|
113
|
+
cursor: default;
|
|
114
|
+
display: flex;
|
|
115
|
+
width: auto;
|
|
116
|
+
padding: 4px;
|
|
117
|
+
padding-inline-start: 0;
|
|
118
|
+
padding-inline-end: 0;
|
|
119
|
+
border-top-left-radius: 8px;
|
|
120
|
+
border-top-right-radius: 8px;
|
|
121
|
+
border-radius: 8px;
|
|
122
|
+
background: var(--puck-color-grey-01);
|
|
123
|
+
color: var(--puck-color-white);
|
|
124
|
+
font-family: var(--puck-font-family);
|
|
125
|
+
min-height: 26px;
|
|
126
|
+
}
|
|
127
|
+
._ActionBar-label_1nmyk_18 {
|
|
128
|
+
color: var(--puck-color-grey-08);
|
|
129
|
+
font-size: var(--puck-font-size-xxxs);
|
|
130
|
+
font-weight: 500;
|
|
131
|
+
padding-inline-start: 8px;
|
|
132
|
+
padding-inline-end: 8px;
|
|
133
|
+
margin-inline-start: 4px;
|
|
134
|
+
margin-inline-end: 4px;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
}
|
|
138
|
+
._ActionBarAction_1nmyk_30 + ._ActionBar-label_1nmyk_18 {
|
|
139
|
+
padding-inline-start: 0;
|
|
140
|
+
}
|
|
141
|
+
._ActionBar-label_1nmyk_18 + ._ActionBarAction_1nmyk_30 {
|
|
142
|
+
margin-inline-start: -4px;
|
|
143
|
+
}
|
|
144
|
+
._ActionBar-group_1nmyk_38 {
|
|
145
|
+
align-items: center;
|
|
146
|
+
border-inline-start: 0.5px solid var(--puck-color-grey-05);
|
|
147
|
+
display: flex;
|
|
148
|
+
height: 100%;
|
|
149
|
+
padding-inline-start: 4px;
|
|
150
|
+
padding-inline-end: 4px;
|
|
151
|
+
}
|
|
152
|
+
._ActionBar-group_1nmyk_38:first-of-type {
|
|
153
|
+
border-inline-start: 0;
|
|
154
|
+
}
|
|
155
|
+
._ActionBar-group_1nmyk_38:empty {
|
|
156
|
+
display: none;
|
|
157
|
+
}
|
|
158
|
+
._ActionBarAction_1nmyk_30 {
|
|
159
|
+
background: transparent;
|
|
160
|
+
border: none;
|
|
161
|
+
color: var(--puck-color-grey-08);
|
|
162
|
+
cursor: pointer;
|
|
163
|
+
padding: 6px;
|
|
164
|
+
margin-inline-start: 4px;
|
|
165
|
+
margin-inline-end: 4px;
|
|
166
|
+
border-radius: 4px;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
justify-content: center;
|
|
171
|
+
transition: color 50ms ease-in;
|
|
172
|
+
}
|
|
173
|
+
._ActionBarAction--disabled_1nmyk_71 {
|
|
174
|
+
cursor: auto;
|
|
175
|
+
color: var(--puck-color-grey-06);
|
|
176
|
+
}
|
|
177
|
+
._ActionBarAction_1nmyk_30 svg {
|
|
178
|
+
max-width: none !important;
|
|
179
|
+
}
|
|
180
|
+
._ActionBarAction_1nmyk_30:focus-visible {
|
|
181
|
+
outline: 2px solid var(--puck-color-azure-05);
|
|
182
|
+
outline-offset: -2px;
|
|
183
|
+
}
|
|
184
|
+
@media (hover: hover) and (pointer: fine) {
|
|
185
|
+
._ActionBarAction_1nmyk_30:hover:not(._ActionBarAction--disabled_1nmyk_71) {
|
|
186
|
+
color: var(--puck-color-azure-06);
|
|
187
|
+
transition: none;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
._ActionBarAction_1nmyk_30:active:not(._ActionBarAction--disabled_1nmyk_71),
|
|
191
|
+
._ActionBarAction--active_1nmyk_93 {
|
|
192
|
+
color: var(--puck-color-azure-07);
|
|
193
|
+
transition: none;
|
|
194
|
+
}
|
|
195
|
+
._ActionBar-group_1nmyk_38 * {
|
|
196
|
+
margin: 0;
|
|
197
|
+
}
|
|
198
|
+
._ActionBar-separator_1nmyk_102 {
|
|
199
|
+
background: var(--puck-color-grey-05);
|
|
200
|
+
margin-inline: 4px;
|
|
201
|
+
width: 0.5px;
|
|
202
|
+
height: 100%;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/RichTextMenu/components/Control/styles.module.css/#css-module-data */
|
|
206
|
+
._Control_1aveu_1 .lucide {
|
|
207
|
+
height: 18px;
|
|
208
|
+
width: 18px;
|
|
209
|
+
}
|
|
210
|
+
._Control--inline_1aveu_6 .lucide {
|
|
211
|
+
height: 16px;
|
|
212
|
+
width: 16px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* css-module:/home/runner/work/puck/puck/packages/core/components/Select/styles.module.css/#css-module-data */
|
|
216
|
+
._Select_xjbef_1 {
|
|
217
|
+
position: relative;
|
|
218
|
+
z-index: 1;
|
|
219
|
+
}
|
|
220
|
+
._Select-button_xjbef_6 {
|
|
221
|
+
align-items: center;
|
|
222
|
+
background: transparent;
|
|
223
|
+
border: none;
|
|
224
|
+
border-radius: 4px;
|
|
225
|
+
display: flex;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
gap: 0px;
|
|
228
|
+
height: 100%;
|
|
229
|
+
padding: 4px;
|
|
230
|
+
padding-right: 2px;
|
|
231
|
+
}
|
|
232
|
+
._Select--hasOptions_xjbef_19 ._Select-button_xjbef_6 {
|
|
233
|
+
color: currentColor;
|
|
234
|
+
}
|
|
235
|
+
._Select--hasOptions_xjbef_19:not(._Select--disabled_xjbef_23) ._Select-button_xjbef_6 {
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
}
|
|
238
|
+
._Select-buttonIcon_xjbef_27 {
|
|
239
|
+
align-items: center;
|
|
240
|
+
display: flex;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
}
|
|
243
|
+
._Select--standalone_xjbef_33 ._Select-buttonIcon_xjbef_27 .lucide {
|
|
244
|
+
height: 18px;
|
|
245
|
+
width: 18px;
|
|
246
|
+
}
|
|
247
|
+
._Select--actionBar_xjbef_38 ._Select-buttonIcon_xjbef_27 .lucide {
|
|
248
|
+
height: 16px;
|
|
249
|
+
width: 16px;
|
|
250
|
+
}
|
|
251
|
+
._Select--hasOptions_xjbef_19:not(._Select--disabled_xjbef_23) ._Select-button_xjbef_6:hover,
|
|
252
|
+
._Select--hasValue_xjbef_44 ._Select-button_xjbef_6 {
|
|
253
|
+
background: var(--puck-color-grey-10);
|
|
254
|
+
color: var(--puck-color-azure-04);
|
|
255
|
+
}
|
|
256
|
+
._Select--disabled_xjbef_23 ._Select-button_xjbef_6 {
|
|
257
|
+
color: var(--puck-color-grey-07);
|
|
258
|
+
}
|
|
259
|
+
._Select--actionBar_xjbef_38 {
|
|
260
|
+
&._Select--hasOptions_xjbef_19 ._Select-button_xjbef_6:hover,
|
|
261
|
+
&._Select--hasValue_xjbef_44 ._Select-button_xjbef_6 {
|
|
262
|
+
background: none;
|
|
263
|
+
color: var(--puck-color-azure-07);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
._Select-items_xjbef_61 {
|
|
267
|
+
background: white;
|
|
268
|
+
border: 1px solid var(--puck-color-grey-09);
|
|
269
|
+
border-radius: 8px;
|
|
270
|
+
margin: 10px 8px;
|
|
271
|
+
margin-left: 0;
|
|
272
|
+
padding: 4px;
|
|
273
|
+
z-index: 2;
|
|
274
|
+
list-style: none;
|
|
275
|
+
}
|
|
276
|
+
._SelectItem_xjbef_72 {
|
|
277
|
+
background: transparent;
|
|
278
|
+
border-radius: 4px;
|
|
279
|
+
border: none;
|
|
280
|
+
color: var(--puck-color-grey-04);
|
|
281
|
+
cursor: pointer;
|
|
282
|
+
display: flex;
|
|
283
|
+
gap: 8px;
|
|
284
|
+
align-items: center;
|
|
285
|
+
font-size: var(--puck-font-size-xxs);
|
|
286
|
+
margin: 0;
|
|
287
|
+
padding: 8px 12px;
|
|
288
|
+
width: 100%;
|
|
289
|
+
}
|
|
290
|
+
._SelectItem--isSelected_xjbef_87 {
|
|
291
|
+
background: var(--puck-color-azure-11);
|
|
292
|
+
color: var(--puck-color-azure-04);
|
|
293
|
+
font-weight: 500;
|
|
294
|
+
}
|
|
295
|
+
._SelectItem--isSelected_xjbef_87 ._SelectItem-icon_xjbef_93 {
|
|
296
|
+
color: var(--puck-color-azure-04);
|
|
297
|
+
}
|
|
298
|
+
._SelectItem_xjbef_72:hover {
|
|
299
|
+
background: var(--puck-color-azure-11);
|
|
300
|
+
color: var(--puck-color-azure-04);
|
|
301
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
LoadedRichTextMenuInner
|
|
3
|
+
} from "./chunk-BSDEIOEK.mjs";
|
|
4
|
+
import "./chunk-PLXSMBAA.mjs";
|
|
5
|
+
import "./chunk-62AAYNXG.mjs";
|
|
6
|
+
import "./chunk-QAWJTCV5.mjs";
|
|
7
|
+
import "./chunk-DAQLMM2T.mjs";
|
|
8
|
+
import "./chunk-QBGM4ELA.mjs";
|
|
9
|
+
import "./chunk-T3WX7XJ6.mjs";
|
|
10
|
+
import "./chunk-Y2EFNT5P.mjs";
|
|
11
|
+
import "./chunk-NLUHDYVR.mjs";
|
|
12
|
+
import {
|
|
13
|
+
__spreadValues,
|
|
14
|
+
init_react_import
|
|
15
|
+
} from "./chunk-M6W7YEVX.mjs";
|
|
16
|
+
|
|
17
|
+
// components/RichTextMenu/full.tsx
|
|
18
|
+
init_react_import();
|
|
19
|
+
import { useEditorState } from "@tiptap/react";
|
|
20
|
+
import { useMemo } from "react";
|
|
21
|
+
|
|
22
|
+
// components/RichTextEditor/selector.ts
|
|
23
|
+
init_react_import();
|
|
24
|
+
var defaultEditorState = (ctx, readOnly) => {
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B;
|
|
26
|
+
const editor = ctx.editor;
|
|
27
|
+
if (!editor) return {};
|
|
28
|
+
const canChain = () => editor.can().chain();
|
|
29
|
+
return {
|
|
30
|
+
isAlignLeft: editor.isActive({ textAlign: "left" }),
|
|
31
|
+
canAlignLeft: !readOnly && ((_b = (_a = canChain()).setTextAlign) == null ? void 0 : _b.call(_a, "left").run()),
|
|
32
|
+
isAlignCenter: editor.isActive({ textAlign: "center" }),
|
|
33
|
+
canAlignCenter: !readOnly && ((_d = (_c = canChain()).setTextAlign) == null ? void 0 : _d.call(_c, "center").run()),
|
|
34
|
+
isAlignRight: editor.isActive({ textAlign: "right" }),
|
|
35
|
+
canAlignRight: !readOnly && ((_f = (_e = canChain()).setTextAlign) == null ? void 0 : _f.call(_e, "right").run()),
|
|
36
|
+
isAlignJustify: editor.isActive({ textAlign: "justify" }),
|
|
37
|
+
canAlignJustify: !readOnly && ((_h = (_g = canChain()).setTextAlign) == null ? void 0 : _h.call(_g, "justify").run()),
|
|
38
|
+
isBold: editor.isActive("bold"),
|
|
39
|
+
canBold: !readOnly && ((_j = (_i = canChain()).toggleBold) == null ? void 0 : _j.call(_i).run()),
|
|
40
|
+
isItalic: editor.isActive("italic"),
|
|
41
|
+
canItalic: !readOnly && ((_l = (_k = canChain()).toggleItalic) == null ? void 0 : _l.call(_k).run()),
|
|
42
|
+
isUnderline: editor.isActive("underline"),
|
|
43
|
+
canUnderline: !readOnly && ((_n = (_m = canChain()).toggleUnderline) == null ? void 0 : _n.call(_m).run()),
|
|
44
|
+
isStrike: editor.isActive("strike"),
|
|
45
|
+
canStrike: !readOnly && ((_p = (_o = canChain()).toggleStrike) == null ? void 0 : _p.call(_o).run()),
|
|
46
|
+
isInlineCode: editor.isActive("code"),
|
|
47
|
+
canInlineCode: !readOnly && ((_r = (_q = canChain()).toggleCode) == null ? void 0 : _r.call(_q).run()),
|
|
48
|
+
isBulletList: editor.isActive("bulletList"),
|
|
49
|
+
canBulletList: !readOnly && ((_t = (_s = canChain()).toggleBulletList) == null ? void 0 : _t.call(_s).run()),
|
|
50
|
+
isOrderedList: editor.isActive("orderedList"),
|
|
51
|
+
canOrderedList: !readOnly && ((_v = (_u = canChain()).toggleOrderedList) == null ? void 0 : _v.call(_u).run()),
|
|
52
|
+
isCodeBlock: editor.isActive("codeBlock"),
|
|
53
|
+
canCodeBlock: !readOnly && ((_x = (_w = canChain()).toggleCodeBlock) == null ? void 0 : _x.call(_w).run()),
|
|
54
|
+
isBlockquote: editor.isActive("blockquote"),
|
|
55
|
+
canBlockquote: !readOnly && ((_z = (_y = canChain()).toggleBlockquote) == null ? void 0 : _z.call(_y).run()),
|
|
56
|
+
canHorizontalRule: !readOnly && ((_B = (_A = canChain()).setHorizontalRule) == null ? void 0 : _B.call(_A).run())
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// components/RichTextMenu/full.tsx
|
|
61
|
+
import { jsx } from "react/jsx-runtime";
|
|
62
|
+
var LoadedRichTextMenuFull = ({
|
|
63
|
+
editor,
|
|
64
|
+
field,
|
|
65
|
+
readOnly,
|
|
66
|
+
inline
|
|
67
|
+
}) => {
|
|
68
|
+
const { tiptap = {} } = field;
|
|
69
|
+
const { selector } = tiptap;
|
|
70
|
+
const resolvedSelector = useMemo(() => {
|
|
71
|
+
return (ctx) => __spreadValues(__spreadValues({}, defaultEditorState(ctx, readOnly)), selector ? selector(ctx, readOnly) : {});
|
|
72
|
+
}, [selector, readOnly]);
|
|
73
|
+
const editorState = useEditorState({
|
|
74
|
+
editor,
|
|
75
|
+
selector: resolvedSelector
|
|
76
|
+
});
|
|
77
|
+
if (!editor || !editorState) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
LoadedRichTextMenuInner,
|
|
82
|
+
{
|
|
83
|
+
editor,
|
|
84
|
+
editorState,
|
|
85
|
+
field,
|
|
86
|
+
readOnly,
|
|
87
|
+
inline
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
LoadedRichTextMenuFull
|
|
93
|
+
};
|