@pie-element/cli 0.1.2-next.14 → 0.1.2-next.15

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.
@@ -22,6 +22,8 @@ export declare const PRESET_IDS: {
22
22
  readonly previewPromptPropTypesShape: "patch.render-ui.preview-prompt-proptypes-shape";
23
23
  readonly correctAnswerToggleStyleNormalization: "patch.correct-answer-toggle.style-key-normalization";
24
24
  readonly plotToolPropTypesCompatibility: "patch.plot.tool-proptypes-compatibility";
25
+ readonly editableHtmlMathjaxIgnore: "patch.editable-html-tip-tap.mathjax-ignore-editor-root";
26
+ readonly editableHtmlMathNodeUnwrap: "patch.editable-html-tip-tap.math-node-unwrap-delimiters";
25
27
  readonly mathRenderingWrapperMode: "mode.math-rendering.wrapper";
26
28
  readonly preserveRenderUiInlineMenu: "preserve.render-ui.inline-menu";
27
29
  readonly depsGraphingDndKit: "deps.graphing.dnd-kit-core";
@@ -11,6 +11,8 @@ export const PRESET_IDS = {
11
11
  previewPromptPropTypesShape: 'patch.render-ui.preview-prompt-proptypes-shape',
12
12
  correctAnswerToggleStyleNormalization: 'patch.correct-answer-toggle.style-key-normalization',
13
13
  plotToolPropTypesCompatibility: 'patch.plot.tool-proptypes-compatibility',
14
+ editableHtmlMathjaxIgnore: 'patch.editable-html-tip-tap.mathjax-ignore-editor-root',
15
+ editableHtmlMathNodeUnwrap: 'patch.editable-html-tip-tap.math-node-unwrap-delimiters',
14
16
  mathRenderingWrapperMode: 'mode.math-rendering.wrapper',
15
17
  preserveRenderUiInlineMenu: 'preserve.render-ui.inline-menu',
16
18
  depsGraphingDndKit: 'deps.graphing.dnd-kit-core',
@@ -84,6 +86,38 @@ export function getPostSyncTextPatches(projectRoot) {
84
86
  { from: " 'user-select': 'none',", to: " userSelect: 'none'," },
85
87
  ],
86
88
  },
89
+ {
90
+ id: PRESET_IDS.editableHtmlMathjaxIgnore,
91
+ label: '@pie-lib/editable-html-tip-tap editor root excluded from MathJax',
92
+ file: join(projectRoot, 'packages/lib-react/editable-html-tip-tap/src/components/EditableHtml.tsx'),
93
+ replacements: [
94
+ {
95
+ from: " 'data-pie-editor': 'true',\n // Without these the browser spellchecks",
96
+ to: " 'data-pie-editor': 'true',\n" +
97
+ " // MathJax's default ignore class. A typeset pass over an ancestor would otherwise typeset the\n" +
98
+ " // editor's text, and ProseMirror reads MathJax's output back into the document.\n" +
99
+ " class: 'mathjax_ignore',\n" +
100
+ ' // Without these the browser spellchecks',
101
+ },
102
+ ],
103
+ },
104
+ {
105
+ id: PRESET_IDS.editableHtmlMathNodeUnwrap,
106
+ label: '@pie-lib/editable-html-tip-tap math node parses bare TeX',
107
+ file: join(projectRoot, 'packages/lib-react/editable-html-tip-tap/src/extensions/math.tsx'),
108
+ replacements: [
109
+ {
110
+ from: "import { wrapMath } from '@pie-element/shared-math-rendering-mathjax';",
111
+ to: "import { unWrapMath, wrapMath } from '@pie-element/shared-math-rendering-mathjax';",
112
+ },
113
+ {
114
+ from: " latex: el.getAttribute('data-raw') || el.textContent,\n",
115
+ to: ' // A span saved without `data-raw`, or with delimiters in it, holds delimited TeX, which\n' +
116
+ ' // `renderHTML` would wrap a second time.\n' +
117
+ " latex: unWrapMath(el.getAttribute('data-raw') || el.textContent).unwrapped,\n",
118
+ },
119
+ ],
120
+ },
87
121
  ];
88
122
  }
89
123
  export function getPieLibSyncMode(pkgName) {
@@ -1 +1 @@
1
- {"version":3,"file":"sync-presets.js","sourceRoot":"","sources":["../../../src/lib/upstream/sync-presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqBjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,iCAAiC,EAAE,4CAA4C;IAC/E,wBAAwB,EAAE,oCAAoC;IAC9D,2BAA2B,EAAE,gDAAgD;IAC7E,qCAAqC,EAAE,qDAAqD;IAC5F,8BAA8B,EAAE,yCAAyC;IACzE,wBAAwB,EAAE,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BAAgB,EAAE,CAAC;QACjC,OAAO;YACL,4CAA4C,EAAE,aAAa;SAC5D,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,+BAA+B,GAAuD;IAC1F,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE;CAC1C,CAAC;AAEF,MAAM,UAAU,gCAAgC,CAC9C,IAA4B;IAE5B,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,MAAM,GAAG,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7F,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,UAAU,CAAC,8BAA8B;QAC7C,cAAc,EAAE,oBAAoB;QACpC,MAAM,EAAE;;;;;;;;;;;;CAYX;KACE;CACF,CAAC","sourcesContent":["import { join } from 'node:path';\n\nexport interface TextReplacement {\n from: string;\n to: string;\n}\n\nexport interface PostSyncTextPatch {\n id: string;\n label: string;\n file: string;\n replacements: TextReplacement[];\n}\n\nexport type PieLibSyncMode = 'full-sync' | 'wrapper';\nexport type PieLibVitePreset =\n | 'default'\n | 'math-rendering-wrapper'\n | 'test-utils'\n | 'editable-html-tip-tap';\n\n/**\n * Central inventory for element/package-specific sync compatibility adaptations.\n *\n * Each entry gets a stable id so it can be referenced in docs/logs/tests without\n * coupling to implementation file names.\n */\nexport const PRESET_IDS = {\n testUtilsDeclarationStabilization: 'patch.test-utils.declaration-stabilization',\n graphingDomPropLeakGuard: 'patch.graphing.dom-prop-leak-guard',\n previewPromptPropTypesShape: 'patch.render-ui.preview-prompt-proptypes-shape',\n correctAnswerToggleStyleNormalization: 'patch.correct-answer-toggle.style-key-normalization',\n plotToolPropTypesCompatibility: 'patch.plot.tool-proptypes-compatibility',\n mathRenderingWrapperMode: 'mode.math-rendering.wrapper',\n preserveRenderUiInlineMenu: 'preserve.render-ui.inline-menu',\n depsGraphingDndKit: 'deps.graphing.dnd-kit-core',\n depsChartingD3Peers: 'deps.charting.d3-peers',\n depsMathRenderingOverride: 'deps.math-rendering.shared-adapter-only',\n viteMathRenderingWrapper: 'vite.math-rendering-wrapper',\n viteTestUtils: 'vite.test-utils',\n viteEditableHtmlTipTap: 'vite.editable-html-tip-tap',\n transformChartingUtilsTypeFix: 'transform.charting.utils-exported-function-types',\n transformTranslatorIndexTypeFix: 'transform.translator.index-type-annotations',\n transformRenderUiInlineMenuExport: 'transform.render-ui.inline-menu-export',\n transformTextSelectTokenTypesReexport: 'transform.text-select.token-types-reexport',\n} as const;\n\nexport function getPostSyncTextPatches(projectRoot: string): PostSyncTextPatch[] {\n return [\n {\n id: PRESET_IDS.testUtilsDeclarationStabilization,\n label: '@pie-lib/test-utils declaration stabilization',\n file: join(projectRoot, 'packages/lib-react/test-utils/src/index.tsx'),\n replacements: [\n {\n from: \"import { render } from '@testing-library/react';\",\n to: \"import { render, type RenderOptions, type RenderResult } from '@testing-library/react';\",\n },\n {\n from: 'export function renderWithTheme(ui, options = {}) {',\n to: 'export function renderWithTheme(ui: React.ReactElement, options: RenderOptions & { theme?: unknown } = {}): RenderResult {',\n },\n {\n from: 'export function renderWithProviders(ui, options = {}) {',\n to: 'export function renderWithProviders(ui: React.ReactElement, options: RenderOptions & { theme?: unknown; providers?: React.ComponentType<{ children?: React.ReactNode }>[] } = {}): RenderResult {',\n },\n ],\n },\n {\n id: PRESET_IDS.graphingDomPropLeakGuard,\n label: '@pie-lib/graphing DOM prop leak guard',\n file: join(projectRoot, 'packages/lib-react/graphing/src/tools/shared/point/base-point.tsx'),\n replacements: [\n {\n from: ' onTouchEnd,\\n ...rest\\n',\n to: ' onTouchEnd\\n',\n },\n {\n from: ' <circle {...rest} r={r} cx={scale.x(x)} cy={scale.y(y)} />',\n to: ' <circle r={r} cx={scale.x(x)} cy={scale.y(y)} />',\n },\n ],\n },\n {\n id: PRESET_IDS.previewPromptPropTypesShape,\n label: '@pie-lib/render-ui PreviewPrompt PropTypes.shape',\n file: join(projectRoot, 'packages/lib-react/render-ui/src/preview-prompt.tsx'),\n replacements: [\n {\n from: ' customAudioButton: {\\n playImage: PropTypes.string,\\n pauseImage: PropTypes.string,\\n },',\n to: ' customAudioButton: PropTypes.shape({\\n playImage: PropTypes.string,\\n pauseImage: PropTypes.string,\\n }),',\n },\n ],\n },\n {\n id: PRESET_IDS.correctAnswerToggleStyleNormalization,\n label: '@pie-lib/correct-answer-toggle style key normalization',\n file: join(projectRoot, 'packages/lib-react/correct-answer-toggle/src/index.tsx'),\n replacements: [\n { from: \" '-webkit-touchCcallout': 'none',\", to: \" WebkitTouchCallout: 'none',\" },\n { from: \" '-webkit-user-select': 'none',\", to: \" WebkitUserSelect: 'none',\" },\n { from: \" '-khtml-user-select': 'none',\", to: \" KhtmlUserSelect: 'none',\" },\n { from: \" '-moz-user-select': 'none',\", to: \" MozUserSelect: 'none',\" },\n { from: \" '-ms-user-select': 'none',\", to: \" msUserSelect: 'none',\" },\n { from: \" 'user-select': 'none',\", to: \" userSelect: 'none',\" },\n ],\n },\n ];\n}\n\nexport function getPieLibSyncMode(pkgName: string): PieLibSyncMode {\n if (pkgName === 'math-rendering') {\n return 'wrapper';\n }\n return 'full-sync';\n}\n\nexport function getPieLibSourcePreserveList(pkgName: string): string[] {\n if (pkgName === 'render-ui') {\n return ['inline-menu.tsx'];\n }\n return [];\n}\n\nexport function shouldGenerateAutosizeInputComponent(pkgName: string): boolean {\n return ['charting', 'graphing', 'graphing-solution-set'].includes(pkgName);\n}\n\nexport function shouldGenerateConfigUiFractionHelper(pkgName: string): boolean {\n return pkgName === 'config-ui';\n}\n\nexport function shouldTransformReactInputAutosizeSource(sourcePath?: string): boolean {\n if (!sourcePath) {\n return true;\n }\n\n return ['charting', 'graphing', 'graphing-solution-set'].some(\n (pkgName) =>\n sourcePath.includes(`pie-lib/packages/${pkgName}/src/`) ||\n sourcePath.includes(`packages/lib-react/${pkgName}/src/`)\n );\n}\n\nexport function shouldTransformConfigUiMathjsSource(sourcePath?: string): boolean {\n if (!sourcePath) {\n return false;\n }\n\n return (\n sourcePath.includes('pie-lib/packages/config-ui/src/number-text-field-custom') ||\n sourcePath.includes('packages/lib-react/config-ui/src/number-text-field-custom')\n );\n}\n\nexport function getPieLibVitePreset(pkgName?: string): PieLibVitePreset {\n if (pkgName === 'math-rendering') {\n return 'math-rendering-wrapper';\n }\n if (pkgName === 'test-utils') {\n return 'test-utils';\n }\n if (pkgName === 'editable-html-tip-tap') {\n return 'editable-html-tip-tap';\n }\n return 'default';\n}\n\nexport function getPieLibDependencyAugmentations(pkgName: string): Record<string, string> {\n if (pkgName === 'graphing') {\n return {\n '@dnd-kit/core': '^6.3.0',\n };\n }\n if (pkgName === 'charting') {\n return {\n 'd3-time': '^3.1.0',\n 'd3-interpolate': '^3.0.1',\n 'd3-shape': '^3.2.0',\n };\n }\n return {};\n}\n\nexport function getPieLibDependencyOverride(pkgName: string): Record<string, string> | null {\n if (pkgName === 'math-rendering') {\n return {\n '@pie-element/shared-math-rendering-mathjax': 'workspace:*',\n };\n }\n return null;\n}\n\n/**\n * Exact versions forced onto a synced package's dependencies, whatever upstream declares.\n *\n * tiptap pins its own peers exactly from 3.24.0 on — `@tiptap/core@3.31.3` peers on\n * `@tiptap/pm: \"3.31.3\"`, not a range — so every `@tiptap/*` package in one install tree has\n * to be the same exact version. Mix them and a second `@tiptap/core` resolves, which breaks\n * ProseMirror on duplicate schema and plugin identity.\n *\n * Upstream pie-lib still declares 3.20.0 and is no longer maintained, so the version lives\n * here instead of being fixed there. This matters because `ensurePieLibPackageJson` rebuilds\n * `dependencies` from the upstream manifest on every sync: without this pin, one\n * `upstream:sync` walks the whole set back to 3.20.0 and silently undoes the alignment.\n *\n * Matched by prefix rather than by name so a newly imported `@tiptap/*` package is pinned as\n * well, instead of arriving as a caret range off whatever happens to be installed. Keep in\n * step with the root `package.json` `overrides`.\n */\nconst PIE_LIB_DEPENDENCY_VERSION_PINS: ReadonlyArray<{ prefix: string; version: string }> = [\n { prefix: '@tiptap/', version: '3.31.3' },\n];\n\nexport function applyPieLibDependencyVersionPins(\n deps: Record<string, string>\n): Record<string, string> {\n const pinned: Record<string, string> = {};\n for (const [depName, version] of Object.entries(deps)) {\n const pin = PIE_LIB_DEPENDENCY_VERSION_PINS.find(({ prefix }) => depName.startsWith(prefix));\n pinned[depName] = pin ? pin.version : version;\n }\n return pinned;\n}\n\nexport const PIE_LIB_COMPATIBILITY_APPEND_PATCHES: Record<\n string,\n { id: string; append: string; requiredMarker: string }\n> = {\n plot: {\n id: PRESET_IDS.plotToolPropTypesCompatibility,\n requiredMarker: 'ToolPropTypeFields',\n append: `\n\n// Local compatibility export used by graphing tool components.\nexport const ToolPropTypeFields = {\n graphProps: GraphPropsType.isRequired,\n mark: PropTypes.object,\n onChange: PropTypes.func,\n onDelete: PropTypes.func,\n onClick: PropTypes.func,\n};\n\nexport const ToolPropType = PropTypes.shape(ToolPropTypeFields);\n`,\n },\n};\n"]}
1
+ {"version":3,"file":"sync-presets.js","sourceRoot":"","sources":["../../../src/lib/upstream/sync-presets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqBjC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,iCAAiC,EAAE,4CAA4C;IAC/E,wBAAwB,EAAE,oCAAoC;IAC9D,2BAA2B,EAAE,gDA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AC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAC7F,MAAM,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAChD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,UAAU,CAAC,8BAA8B;QAC7C,cAAc,EAAE,oBAAoB;QACpC,MAAM,EAAE;;;;;;;;;;;;CAYX;KACE;CACF,CAAC","sourcesContent":["import { join } from 'node:path';\n\nexport interface TextReplacement {\n from: string;\n to: string;\n}\n\nexport interface PostSyncTextPatch {\n id: string;\n label: string;\n file: string;\n replacements: TextReplacement[];\n}\n\nexport type PieLibSyncMode = 'full-sync' | 'wrapper';\nexport type PieLibVitePreset =\n | 'default'\n | 'math-rendering-wrapper'\n | 'test-utils'\n | 'editable-html-tip-tap';\n\n/**\n * Central inventory for element/package-specific sync compatibility adaptations.\n *\n * Each entry gets a stable id so it can be referenced in docs/logs/tests without\n * coupling to implementation file names.\n */\nexport const PRESET_IDS = {\n testUtilsDeclarationStabilization: 'patch.test-utils.declaration-stabilization',\n graphingDomPropLeakGuard: 'patch.graphing.dom-prop-leak-guard',\n previewPromptPropTypesShape: 'patch.render-ui.preview-prompt-proptypes-shape',\n correctAnswerToggleStyleNormalization: 'patch.correct-answer-toggle.style-key-normalization',\n plotToolPropTypesCompatibility: 'patch.plot.tool-proptypes-compatibility',\n editableHtmlMathjaxIgnore: 'patch.editable-html-tip-tap.mathjax-ignore-editor-root',\n editableHtmlMathNodeUnwrap: 'patch.editable-html-tip-tap.math-node-unwrap-delimiters',\n mathRenderingWrapperMode: 'mode.math-rendering.wrapper',\n preserveRenderUiInlineMenu: 'preserve.render-ui.inline-menu',\n depsGraphingDndKit: 'deps.graphing.dnd-kit-core',\n depsChartingD3Peers: 'deps.charting.d3-peers',\n depsMathRenderingOverride: 'deps.math-rendering.shared-adapter-only',\n viteMathRenderingWrapper: 'vite.math-rendering-wrapper',\n viteTestUtils: 'vite.test-utils',\n viteEditableHtmlTipTap: 'vite.editable-html-tip-tap',\n transformChartingUtilsTypeFix: 'transform.charting.utils-exported-function-types',\n transformTranslatorIndexTypeFix: 'transform.translator.index-type-annotations',\n transformRenderUiInlineMenuExport: 'transform.render-ui.inline-menu-export',\n transformTextSelectTokenTypesReexport: 'transform.text-select.token-types-reexport',\n} as const;\n\nexport function getPostSyncTextPatches(projectRoot: string): PostSyncTextPatch[] {\n return [\n {\n id: PRESET_IDS.testUtilsDeclarationStabilization,\n label: '@pie-lib/test-utils declaration stabilization',\n file: join(projectRoot, 'packages/lib-react/test-utils/src/index.tsx'),\n replacements: [\n {\n from: \"import { render } from '@testing-library/react';\",\n to: \"import { render, type RenderOptions, type RenderResult } from '@testing-library/react';\",\n },\n {\n from: 'export function renderWithTheme(ui, options = {}) {',\n to: 'export function renderWithTheme(ui: React.ReactElement, options: RenderOptions & { theme?: unknown } = {}): RenderResult {',\n },\n {\n from: 'export function renderWithProviders(ui, options = {}) {',\n to: 'export function renderWithProviders(ui: React.ReactElement, options: RenderOptions & { theme?: unknown; providers?: React.ComponentType<{ children?: React.ReactNode }>[] } = {}): RenderResult {',\n },\n ],\n },\n {\n id: PRESET_IDS.graphingDomPropLeakGuard,\n label: '@pie-lib/graphing DOM prop leak guard',\n file: join(projectRoot, 'packages/lib-react/graphing/src/tools/shared/point/base-point.tsx'),\n replacements: [\n {\n from: ' onTouchEnd,\\n ...rest\\n',\n to: ' onTouchEnd\\n',\n },\n {\n from: ' <circle {...rest} r={r} cx={scale.x(x)} cy={scale.y(y)} />',\n to: ' <circle r={r} cx={scale.x(x)} cy={scale.y(y)} />',\n },\n ],\n },\n {\n id: PRESET_IDS.previewPromptPropTypesShape,\n label: '@pie-lib/render-ui PreviewPrompt PropTypes.shape',\n file: join(projectRoot, 'packages/lib-react/render-ui/src/preview-prompt.tsx'),\n replacements: [\n {\n from: ' customAudioButton: {\\n playImage: PropTypes.string,\\n pauseImage: PropTypes.string,\\n },',\n to: ' customAudioButton: PropTypes.shape({\\n playImage: PropTypes.string,\\n pauseImage: PropTypes.string,\\n }),',\n },\n ],\n },\n {\n id: PRESET_IDS.correctAnswerToggleStyleNormalization,\n label: '@pie-lib/correct-answer-toggle style key normalization',\n file: join(projectRoot, 'packages/lib-react/correct-answer-toggle/src/index.tsx'),\n replacements: [\n { from: \" '-webkit-touchCcallout': 'none',\", to: \" WebkitTouchCallout: 'none',\" },\n { from: \" '-webkit-user-select': 'none',\", to: \" WebkitUserSelect: 'none',\" },\n { from: \" '-khtml-user-select': 'none',\", to: \" KhtmlUserSelect: 'none',\" },\n { from: \" '-moz-user-select': 'none',\", to: \" MozUserSelect: 'none',\" },\n { from: \" '-ms-user-select': 'none',\", to: \" msUserSelect: 'none',\" },\n { from: \" 'user-select': 'none',\", to: \" userSelect: 'none',\" },\n ],\n },\n {\n id: PRESET_IDS.editableHtmlMathjaxIgnore,\n label: '@pie-lib/editable-html-tip-tap editor root excluded from MathJax',\n file: join(\n projectRoot,\n 'packages/lib-react/editable-html-tip-tap/src/components/EditableHtml.tsx'\n ),\n replacements: [\n {\n from: \" 'data-pie-editor': 'true',\\n // Without these the browser spellchecks\",\n to:\n \" 'data-pie-editor': 'true',\\n\" +\n \" // MathJax's default ignore class. A typeset pass over an ancestor would otherwise typeset the\\n\" +\n \" // editor's text, and ProseMirror reads MathJax's output back into the document.\\n\" +\n \" class: 'mathjax_ignore',\\n\" +\n ' // Without these the browser spellchecks',\n },\n ],\n },\n {\n id: PRESET_IDS.editableHtmlMathNodeUnwrap,\n label: '@pie-lib/editable-html-tip-tap math node parses bare TeX',\n file: join(projectRoot, 'packages/lib-react/editable-html-tip-tap/src/extensions/math.tsx'),\n replacements: [\n {\n from: \"import { wrapMath } from '@pie-element/shared-math-rendering-mathjax';\",\n to: \"import { unWrapMath, wrapMath } from '@pie-element/shared-math-rendering-mathjax';\",\n },\n {\n from: \" latex: el.getAttribute('data-raw') || el.textContent,\\n\",\n to:\n ' // A span saved without `data-raw`, or with delimiters in it, holds delimited TeX, which\\n' +\n ' // `renderHTML` would wrap a second time.\\n' +\n \" latex: unWrapMath(el.getAttribute('data-raw') || el.textContent).unwrapped,\\n\",\n },\n ],\n },\n ];\n}\n\nexport function getPieLibSyncMode(pkgName: string): PieLibSyncMode {\n if (pkgName === 'math-rendering') {\n return 'wrapper';\n }\n return 'full-sync';\n}\n\nexport function getPieLibSourcePreserveList(pkgName: string): string[] {\n if (pkgName === 'render-ui') {\n return ['inline-menu.tsx'];\n }\n return [];\n}\n\nexport function shouldGenerateAutosizeInputComponent(pkgName: string): boolean {\n return ['charting', 'graphing', 'graphing-solution-set'].includes(pkgName);\n}\n\nexport function shouldGenerateConfigUiFractionHelper(pkgName: string): boolean {\n return pkgName === 'config-ui';\n}\n\nexport function shouldTransformReactInputAutosizeSource(sourcePath?: string): boolean {\n if (!sourcePath) {\n return true;\n }\n\n return ['charting', 'graphing', 'graphing-solution-set'].some(\n (pkgName) =>\n sourcePath.includes(`pie-lib/packages/${pkgName}/src/`) ||\n sourcePath.includes(`packages/lib-react/${pkgName}/src/`)\n );\n}\n\nexport function shouldTransformConfigUiMathjsSource(sourcePath?: string): boolean {\n if (!sourcePath) {\n return false;\n }\n\n return (\n sourcePath.includes('pie-lib/packages/config-ui/src/number-text-field-custom') ||\n sourcePath.includes('packages/lib-react/config-ui/src/number-text-field-custom')\n );\n}\n\nexport function getPieLibVitePreset(pkgName?: string): PieLibVitePreset {\n if (pkgName === 'math-rendering') {\n return 'math-rendering-wrapper';\n }\n if (pkgName === 'test-utils') {\n return 'test-utils';\n }\n if (pkgName === 'editable-html-tip-tap') {\n return 'editable-html-tip-tap';\n }\n return 'default';\n}\n\nexport function getPieLibDependencyAugmentations(pkgName: string): Record<string, string> {\n if (pkgName === 'graphing') {\n return {\n '@dnd-kit/core': '^6.3.0',\n };\n }\n if (pkgName === 'charting') {\n return {\n 'd3-time': '^3.1.0',\n 'd3-interpolate': '^3.0.1',\n 'd3-shape': '^3.2.0',\n };\n }\n return {};\n}\n\nexport function getPieLibDependencyOverride(pkgName: string): Record<string, string> | null {\n if (pkgName === 'math-rendering') {\n return {\n '@pie-element/shared-math-rendering-mathjax': 'workspace:*',\n };\n }\n return null;\n}\n\n/**\n * Exact versions forced onto a synced package's dependencies, whatever upstream declares.\n *\n * tiptap pins its own peers exactly from 3.24.0 on — `@tiptap/core@3.31.3` peers on\n * `@tiptap/pm: \"3.31.3\"`, not a range — so every `@tiptap/*` package in one install tree has\n * to be the same exact version. Mix them and a second `@tiptap/core` resolves, which breaks\n * ProseMirror on duplicate schema and plugin identity.\n *\n * Upstream pie-lib still declares 3.20.0 and is no longer maintained, so the version lives\n * here instead of being fixed there. This matters because `ensurePieLibPackageJson` rebuilds\n * `dependencies` from the upstream manifest on every sync: without this pin, one\n * `upstream:sync` walks the whole set back to 3.20.0 and silently undoes the alignment.\n *\n * Matched by prefix rather than by name so a newly imported `@tiptap/*` package is pinned as\n * well, instead of arriving as a caret range off whatever happens to be installed. Keep in\n * step with the root `package.json` `overrides`.\n */\nconst PIE_LIB_DEPENDENCY_VERSION_PINS: ReadonlyArray<{ prefix: string; version: string }> = [\n { prefix: '@tiptap/', version: '3.31.3' },\n];\n\nexport function applyPieLibDependencyVersionPins(\n deps: Record<string, string>\n): Record<string, string> {\n const pinned: Record<string, string> = {};\n for (const [depName, version] of Object.entries(deps)) {\n const pin = PIE_LIB_DEPENDENCY_VERSION_PINS.find(({ prefix }) => depName.startsWith(prefix));\n pinned[depName] = pin ? pin.version : version;\n }\n return pinned;\n}\n\nexport const PIE_LIB_COMPATIBILITY_APPEND_PATCHES: Record<\n string,\n { id: string; append: string; requiredMarker: string }\n> = {\n plot: {\n id: PRESET_IDS.plotToolPropTypesCompatibility,\n requiredMarker: 'ToolPropTypeFields',\n append: `\n\n// Local compatibility export used by graphing tool components.\nexport const ToolPropTypeFields = {\n graphProps: GraphPropsType.isRequired,\n mark: PropTypes.object,\n onChange: PropTypes.func,\n onDelete: PropTypes.func,\n onClick: PropTypes.func,\n};\n\nexport const ToolPropType = PropTypes.shape(ToolPropTypeFields);\n`,\n },\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/cli",
3
- "version": "0.1.2-next.14",
3
+ "version": "0.1.2-next.15",
4
4
  "description": "CLI tools for managing PIE Elements NG",
5
5
  "type": "module",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@oclif/core": "^4.0.0",
25
25
  "@oclif/plugin-help": "^6.2.0",
26
- "@pie-element/element-bundler": "0.1.2-next.6",
26
+ "@pie-element/element-bundler": "0.1.2-next.7",
27
27
  "es-module-lexer": "^1.7.0",
28
28
  "glob": "^13.0.0",
29
29
  "open": "^10.0.3",