@puckeditor/plugin-ai 0.1.0-canary.0f9dfd6d → 0.1.0-canary.1bc04c29
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.js +8 -3
- package/dist/index.mjs +8 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21566,6 +21566,7 @@ function Chat2({
|
|
|
21566
21566
|
case "data-build-op": {
|
|
21567
21567
|
const data = dataPart.data;
|
|
21568
21568
|
q.queue(() => {
|
|
21569
|
+
var _a17, _b, _c, _d;
|
|
21569
21570
|
const puckDispatch2 = getPuck().dispatch;
|
|
21570
21571
|
try {
|
|
21571
21572
|
if (data.op === "add") {
|
|
@@ -21612,11 +21613,13 @@ function Chat2({
|
|
|
21612
21613
|
recordHistory: false
|
|
21613
21614
|
});
|
|
21614
21615
|
} else if (data.op === "updateRoot") {
|
|
21615
|
-
const
|
|
21616
|
+
const { appState, config: config2 } = getPuck();
|
|
21617
|
+
const existing = appState.data.root;
|
|
21618
|
+
const defaultProps = (_b = (_a17 = config2.root) == null ? void 0 : _a17.defaultProps) != null ? _b : {};
|
|
21616
21619
|
puckDispatch2({
|
|
21617
21620
|
type: "replaceRoot",
|
|
21618
21621
|
root: __spreadProps(__spreadValues({}, existing), {
|
|
21619
|
-
props: __spreadValues(__spreadValues({}, existing.props), data.props)
|
|
21622
|
+
props: __spreadValues(__spreadValues(__spreadValues({}, defaultProps), existing.props), data.props)
|
|
21620
21623
|
}),
|
|
21621
21624
|
recordHistory: false
|
|
21622
21625
|
});
|
|
@@ -21662,9 +21665,11 @@ function Chat2({
|
|
|
21662
21665
|
recordHistory: false
|
|
21663
21666
|
});
|
|
21664
21667
|
} else if (data.op === "reset") {
|
|
21668
|
+
const { config: config2 } = getPuck();
|
|
21669
|
+
const defaultRootProps = (_d = (_c = config2.root) == null ? void 0 : _c.defaultProps) != null ? _d : {};
|
|
21665
21670
|
puckDispatch2({
|
|
21666
21671
|
type: "setData",
|
|
21667
|
-
data: { content: [], root:
|
|
21672
|
+
data: { content: [], root: defaultRootProps },
|
|
21668
21673
|
recordHistory: false
|
|
21669
21674
|
});
|
|
21670
21675
|
} else {
|
package/dist/index.mjs
CHANGED
|
@@ -21561,6 +21561,7 @@ function Chat2({
|
|
|
21561
21561
|
case "data-build-op": {
|
|
21562
21562
|
const data = dataPart.data;
|
|
21563
21563
|
q.queue(() => {
|
|
21564
|
+
var _a17, _b, _c, _d;
|
|
21564
21565
|
const puckDispatch2 = getPuck().dispatch;
|
|
21565
21566
|
try {
|
|
21566
21567
|
if (data.op === "add") {
|
|
@@ -21607,11 +21608,13 @@ function Chat2({
|
|
|
21607
21608
|
recordHistory: false
|
|
21608
21609
|
});
|
|
21609
21610
|
} else if (data.op === "updateRoot") {
|
|
21610
|
-
const
|
|
21611
|
+
const { appState, config: config2 } = getPuck();
|
|
21612
|
+
const existing = appState.data.root;
|
|
21613
|
+
const defaultProps = (_b = (_a17 = config2.root) == null ? void 0 : _a17.defaultProps) != null ? _b : {};
|
|
21611
21614
|
puckDispatch2({
|
|
21612
21615
|
type: "replaceRoot",
|
|
21613
21616
|
root: __spreadProps(__spreadValues({}, existing), {
|
|
21614
|
-
props: __spreadValues(__spreadValues({}, existing.props), data.props)
|
|
21617
|
+
props: __spreadValues(__spreadValues(__spreadValues({}, defaultProps), existing.props), data.props)
|
|
21615
21618
|
}),
|
|
21616
21619
|
recordHistory: false
|
|
21617
21620
|
});
|
|
@@ -21657,9 +21660,11 @@ function Chat2({
|
|
|
21657
21660
|
recordHistory: false
|
|
21658
21661
|
});
|
|
21659
21662
|
} else if (data.op === "reset") {
|
|
21663
|
+
const { config: config2 } = getPuck();
|
|
21664
|
+
const defaultRootProps = (_d = (_c = config2.root) == null ? void 0 : _c.defaultProps) != null ? _d : {};
|
|
21660
21665
|
puckDispatch2({
|
|
21661
21666
|
type: "setData",
|
|
21662
|
-
data: { content: [], root:
|
|
21667
|
+
data: { content: [], root: defaultRootProps },
|
|
21663
21668
|
recordHistory: false
|
|
21664
21669
|
});
|
|
21665
21670
|
} else {
|
package/package.json
CHANGED