Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
smoores-dev committed Oct 11, 2024
1 parent fb0844c commit 42ffc06
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 27 deletions.
4 changes: 1 addition & 3 deletions dist/cjs/components/ChildNodeViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,7 @@ const ChildElement = /*#__PURE__*/ (0, _react.memo)(function ChildElement(param)
* as its child prop is shallowly equivalent to the previous render.
* posToKey will be updated on every doc update, but if the child
* hasn't changed, it will still have the same key.
*/ (prevProps, nextProps)=>prevProps.child.type === nextProps.child.type && prevProps.child.marks.every((mark)=>mark.isInSet(nextProps.child.marks)) && nextProps.child.marks.every((mark)=>mark.isInSet(prevProps.child.marks)) && prevProps.child.offset === nextProps.child.offset && // @ts-expect-error It's fine if these are undefined
prevProps.child.node === nextProps.child.node && // @ts-expect-error It's fine if these are undefined
prevProps.child.widget === nextProps.child.widget);
*/ (prevProps, nextProps)=>prevProps.child.type === nextProps.child.type && prevProps.child.marks.every((mark)=>mark.isInSet(nextProps.child.marks)) && nextProps.child.marks.every((mark)=>mark.isInSet(prevProps.child.marks)) && prevProps.child.offset === nextProps.child.offset && (prevProps.child.type === "node" ? prevProps.child.outerDeco?.length === nextProps.child.outerDeco?.length && prevProps.child.outerDeco?.every((prevDeco)=>nextProps.child.outerDeco?.some((nextDeco)=>prevDeco.from === nextDeco.from && prevDeco.to && nextDeco.to && prevDeco.type.eq(nextDeco.type))) && prevProps.child.innerDeco.eq(nextProps.child.innerDeco) : true) && prevProps.child.node === nextProps.child.node && prevProps.child.widget === nextProps.child.widget);
function createChildElements(children, getInnerPos, // doc: Node | undefined,
posToKey) {
if (!children.length) return [];
Expand Down
29 changes: 19 additions & 10 deletions dist/cjs/components/__tests__/ProseMirror.draw-decoration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,22 +234,25 @@ describe("Decoration drawing", ()=>{
doc: (0, _prosemirrorTestBuilder.doc)((0, _prosemirrorTestBuilder.p)("foobar")),
plugins: [
decoPlugin([
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function B(props, ref) {
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function B(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ _react.default.createElement("span", _extends({
ref: ref
}, props), "B");
}), {
key: "widget-b"
}),
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function A(props, ref) {
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function A(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ _react.default.createElement("span", _extends({
ref: ref
}, props), "A");
}), {
side: -100,
key: "widget-a"
}),
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function C(props, ref) {
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function C(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ _react.default.createElement("span", _extends({
ref: ref
}, props), "C");
Expand Down Expand Up @@ -300,7 +303,8 @@ describe("Decoration drawing", ()=>{
});
it("calls widget destroy methods", async ()=>{
let destroyed = false;
const DestroyableWidget = /*#__PURE__*/ (0, _react.forwardRef)(function DestroyableWidget(props, ref) {
const DestroyableWidget = /*#__PURE__*/ (0, _react.forwardRef)(function DestroyableWidget(param, ref) {
let { widget , getPos , ...props } = param;
(0, _react.useEffect)(()=>{
destroyed = true;
});
Expand Down Expand Up @@ -732,7 +736,8 @@ describe("Decoration drawing", ()=>{
doc: (0, _prosemirrorTestBuilder.doc)((0, _prosemirrorTestBuilder.p)("foobar")),
plugins: [
decoPlugin([
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function Img(props, ref) {
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function Img(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ _react.default.createElement("img", _extends({}, props, {
ref: ref
}));
Expand All @@ -752,7 +757,8 @@ describe("Decoration drawing", ()=>{
doc: (0, _prosemirrorTestBuilder.doc)((0, _prosemirrorTestBuilder.p)((0, _prosemirrorTestBuilder.em)("foo"), (0, _prosemirrorTestBuilder.strong)("bar"))),
plugins: [
decoPlugin([
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function Img(props, ref) {
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function Img(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ _react.default.createElement("img", _extends({}, props, {
ref: ref
}));
Expand All @@ -762,7 +768,8 @@ describe("Decoration drawing", ()=>{
})
]),
decoPlugin([
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function BR(props, ref) {
(0, _reactWidgetTypeJs.widget)(4, /*#__PURE__*/ (0, _react.forwardRef)(function BR(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ _react.default.createElement("br", _extends({}, props, {
ref: ref
}));
Expand Down Expand Up @@ -802,7 +809,8 @@ describe("Decoration drawing", ()=>{
},
plugins: [
decoPlugin([
(0, _reactWidgetTypeJs.widget)(2, /*#__PURE__*/ (0, _react.forwardRef)(function Img(props, ref) {
(0, _reactWidgetTypeJs.widget)(2, /*#__PURE__*/ (0, _react.forwardRef)(function Img(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ _react.default.createElement("img", _extends({}, props, {
ref: ref
}));
Expand All @@ -819,7 +827,8 @@ describe("Decoration drawing", ()=>{
doc: (0, _prosemirrorTestBuilder.doc)((0, _prosemirrorTestBuilder.p)("hi")),
decorations (state) {
return _prosemirrorView.DecorationSet.create(state.doc, [
(0, _reactWidgetTypeJs.widget)(3, /*#__PURE__*/ (0, _react.forwardRef)(function Span(props, ref) {
(0, _reactWidgetTypeJs.widget)(3, /*#__PURE__*/ (0, _react.forwardRef)(function Span(param, ref) {
let { widget , getPos , ...props } = param;
(0, _useEditorEffectJs.useEditorEffect)((view)=>{
expect(view.state).toBe(state);
});
Expand All @@ -840,7 +849,7 @@ describe("Decoration drawing", ()=>{
decorations (state) {
return _prosemirrorView.DecorationSet.create(state.doc, [
(0, _reactWidgetTypeJs.widget)(3, /*#__PURE__*/ (0, _react.forwardRef)(function Widget(param, ref) {
let { getPos , ...props } = param;
let { widget , getPos , ...props } = param;
expect(getPos()).toBe(3);
return /*#__PURE__*/ _react.default.createElement("button", _extends({
ref: ref
Expand Down
4 changes: 1 addition & 3 deletions dist/esm/components/ChildNodeViews.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,7 @@ const ChildElement = /*#__PURE__*/ memo(function ChildElement(param) {
* as its child prop is shallowly equivalent to the previous render.
* posToKey will be updated on every doc update, but if the child
* hasn't changed, it will still have the same key.
*/ (prevProps, nextProps)=>prevProps.child.type === nextProps.child.type && prevProps.child.marks.every((mark)=>mark.isInSet(nextProps.child.marks)) && nextProps.child.marks.every((mark)=>mark.isInSet(prevProps.child.marks)) && prevProps.child.offset === nextProps.child.offset && // @ts-expect-error It's fine if these are undefined
prevProps.child.node === nextProps.child.node && // @ts-expect-error It's fine if these are undefined
prevProps.child.widget === nextProps.child.widget);
*/ (prevProps, nextProps)=>prevProps.child.type === nextProps.child.type && prevProps.child.marks.every((mark)=>mark.isInSet(nextProps.child.marks)) && nextProps.child.marks.every((mark)=>mark.isInSet(prevProps.child.marks)) && prevProps.child.offset === nextProps.child.offset && (prevProps.child.type === "node" ? prevProps.child.outerDeco?.length === nextProps.child.outerDeco?.length && prevProps.child.outerDeco?.every((prevDeco)=>nextProps.child.outerDeco?.some((nextDeco)=>prevDeco.from === nextDeco.from && prevDeco.to && nextDeco.to && prevDeco.type.eq(nextDeco.type))) && prevProps.child.innerDeco.eq(nextProps.child.innerDeco) : true) && prevProps.child.node === nextProps.child.node && prevProps.child.widget === nextProps.child.widget);
function createChildElements(children, getInnerPos, // doc: Node | undefined,
posToKey) {
if (!children.length) return [];
Expand Down
29 changes: 19 additions & 10 deletions dist/esm/components/__tests__/ProseMirror.draw-decoration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,25 @@ describe("Decoration drawing", ()=>{
doc: doc(p("foobar")),
plugins: [
decoPlugin([
widget(4, /*#__PURE__*/ forwardRef(function B(props, ref) {
widget(4, /*#__PURE__*/ forwardRef(function B(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ React.createElement("span", _extends({
ref: ref
}, props), "B");
}), {
key: "widget-b"
}),
widget(4, /*#__PURE__*/ forwardRef(function A(props, ref) {
widget(4, /*#__PURE__*/ forwardRef(function A(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ React.createElement("span", _extends({
ref: ref
}, props), "A");
}), {
side: -100,
key: "widget-a"
}),
widget(4, /*#__PURE__*/ forwardRef(function C(props, ref) {
widget(4, /*#__PURE__*/ forwardRef(function C(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ React.createElement("span", _extends({
ref: ref
}, props), "C");
Expand Down Expand Up @@ -257,7 +260,8 @@ describe("Decoration drawing", ()=>{
});
it("calls widget destroy methods", async ()=>{
let destroyed = false;
const DestroyableWidget = /*#__PURE__*/ forwardRef(function DestroyableWidget(props, ref) {
const DestroyableWidget = /*#__PURE__*/ forwardRef(function DestroyableWidget(param, ref) {
let { widget , getPos , ...props } = param;
useEffect(()=>{
destroyed = true;
});
Expand Down Expand Up @@ -689,7 +693,8 @@ describe("Decoration drawing", ()=>{
doc: doc(p("foobar")),
plugins: [
decoPlugin([
widget(4, /*#__PURE__*/ forwardRef(function Img(props, ref) {
widget(4, /*#__PURE__*/ forwardRef(function Img(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ React.createElement("img", _extends({}, props, {
ref: ref
}));
Expand All @@ -709,7 +714,8 @@ describe("Decoration drawing", ()=>{
doc: doc(p(em("foo"), strong("bar"))),
plugins: [
decoPlugin([
widget(4, /*#__PURE__*/ forwardRef(function Img(props, ref) {
widget(4, /*#__PURE__*/ forwardRef(function Img(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ React.createElement("img", _extends({}, props, {
ref: ref
}));
Expand All @@ -719,7 +725,8 @@ describe("Decoration drawing", ()=>{
})
]),
decoPlugin([
widget(4, /*#__PURE__*/ forwardRef(function BR(props, ref) {
widget(4, /*#__PURE__*/ forwardRef(function BR(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ React.createElement("br", _extends({}, props, {
ref: ref
}));
Expand Down Expand Up @@ -759,7 +766,8 @@ describe("Decoration drawing", ()=>{
},
plugins: [
decoPlugin([
widget(2, /*#__PURE__*/ forwardRef(function Img(props, ref) {
widget(2, /*#__PURE__*/ forwardRef(function Img(param, ref) {
let { widget , getPos , ...props } = param;
return /*#__PURE__*/ React.createElement("img", _extends({}, props, {
ref: ref
}));
Expand All @@ -776,7 +784,8 @@ describe("Decoration drawing", ()=>{
doc: doc(p("hi")),
decorations (state) {
return DecorationSet.create(state.doc, [
widget(3, /*#__PURE__*/ forwardRef(function Span(props, ref) {
widget(3, /*#__PURE__*/ forwardRef(function Span(param, ref) {
let { widget , getPos , ...props } = param;
useEditorEffect((view)=>{
expect(view.state).toBe(state);
});
Expand All @@ -797,7 +806,7 @@ describe("Decoration drawing", ()=>{
decorations (state) {
return DecorationSet.create(state.doc, [
widget(3, /*#__PURE__*/ forwardRef(function Widget(param, ref) {
let { getPos , ...props } = param;
let { widget , getPos , ...props } = param;
expect(getPos()).toBe(3);
return /*#__PURE__*/ React.createElement("button", _extends({
ref: ref
Expand Down
2 changes: 1 addition & 1 deletion dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

0 comments on commit 42ffc06

Please sign in to comment.