@pie-element/cli 0.1.2 → 0.1.3-next.20261002220849

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.
@@ -24,8 +24,10 @@ export declare const PRESET_IDS: {
24
24
  readonly plotToolPropTypesCompatibility: "patch.plot.tool-proptypes-compatibility";
25
25
  readonly editableHtmlMathjaxIgnore: "patch.editable-html-tip-tap.mathjax-ignore-editor-root";
26
26
  readonly editableHtmlMathNodeUnwrap: "patch.editable-html-tip-tap.math-node-unwrap-delimiters";
27
+ readonly editableHtmlPlainTextPaste: "patch.editable-html-tip-tap.plain-text-paste";
27
28
  readonly mathRenderingWrapperMode: "mode.math-rendering.wrapper";
28
29
  readonly preserveRenderUiInlineMenu: "preserve.render-ui.inline-menu";
30
+ readonly preserveEditableHtmlPlainTextPaste: "preserve.editable-html-tip-tap.plain-text-paste";
29
31
  readonly depsGraphingDndKit: "deps.graphing.dnd-kit-core";
30
32
  readonly depsChartingD3Peers: "deps.charting.d3-peers";
31
33
  readonly depsMathRenderingOverride: "deps.math-rendering.shared-adapter-only";
@@ -13,8 +13,10 @@ export const PRESET_IDS = {
13
13
  plotToolPropTypesCompatibility: 'patch.plot.tool-proptypes-compatibility',
14
14
  editableHtmlMathjaxIgnore: 'patch.editable-html-tip-tap.mathjax-ignore-editor-root',
15
15
  editableHtmlMathNodeUnwrap: 'patch.editable-html-tip-tap.math-node-unwrap-delimiters',
16
+ editableHtmlPlainTextPaste: 'patch.editable-html-tip-tap.plain-text-paste',
16
17
  mathRenderingWrapperMode: 'mode.math-rendering.wrapper',
17
18
  preserveRenderUiInlineMenu: 'preserve.render-ui.inline-menu',
19
+ preserveEditableHtmlPlainTextPaste: 'preserve.editable-html-tip-tap.plain-text-paste',
18
20
  depsGraphingDndKit: 'deps.graphing.dnd-kit-core',
19
21
  depsChartingD3Peers: 'deps.charting.d3-peers',
20
22
  depsMathRenderingOverride: 'deps.math-rendering.shared-adapter-only',
@@ -118,6 +120,26 @@ export function getPostSyncTextPatches(projectRoot) {
118
120
  },
119
121
  ],
120
122
  },
123
+ {
124
+ id: PRESET_IDS.editableHtmlPlainTextPaste,
125
+ label: '@pie-lib/editable-html-tip-tap pastes external rich text as plain text',
126
+ file: join(projectRoot, 'packages/lib-react/editable-html-tip-tap/src/components/EditableHtml.tsx'),
127
+ // Each `from` spans the two lines the insertion splits, so a patched file no longer matches.
128
+ // The import is anchored short of the next line's specifier, which gains `.js` only after
129
+ // these patches run. `preserve.editable-html-tip-tap.plain-text-paste` keeps the imported file.
130
+ replacements: [
131
+ {
132
+ from: "import Placeholder from '@tiptap/extension-placeholder';\nimport { normalizeInitialMarkup }",
133
+ to: "import Placeholder from '@tiptap/extension-placeholder';\n" +
134
+ "import { PlainTextPaste } from '../plain-text-paste.js';\n" +
135
+ 'import { normalizeInitialMarkup }',
136
+ },
137
+ {
138
+ from: ' TextStyleKit,\n CharacterCount.configure({',
139
+ to: ' TextStyleKit,\n PlainTextPaste,\n CharacterCount.configure({',
140
+ },
141
+ ],
142
+ },
121
143
  ];
122
144
  }
123
145
  export function getPieLibSyncMode(pkgName) {
@@ -130,6 +152,9 @@ export function getPieLibSourcePreserveList(pkgName) {
130
152
  if (pkgName === 'render-ui') {
131
153
  return ['inline-menu.tsx'];
132
154
  }
155
+ if (pkgName === 'editable-html-tip-tap') {
156
+ return ['plain-text-paste.ts'];
157
+ }
133
158
  return [];
134
159
  }
135
160
  export function shouldGenerateAutosizeInputComponent(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,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,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"]}
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,yBAAyB,EAAE,wDAAwD;IACnF,0BAA0B,EAAE,yDAAyD;IACrF,0BAA0B,EAAE,8CAA8C;IAC1E,wBAAwB,EAAE,6BAA6B;IACvD,0BAA0B,EAAE,gCAAgC;IAC5D,kCAAkC,EAAE,iDAAiD;IACrF,kBAAkB,EAAE,4BAA4B;IAChD,mBAAmB,EAAE,wBAAwB;IAC7C,yBAAyB,EAAE,yCAAyC;IACpE,wBAAwB,EAAE,6BAA6B;IACvD,aAAa,EAAE,iBAAiB;IAChC,sBAAsB,EAAE,4BAA4B;IACpD,6BAA6B,EAAE,kDAAkD;IACjF,+BAA+B,EAAE,6CAA6C;IAC9E,iCAAiC,EAAE,wCAAwC;IAC3E,qCAAqC,EAAE,4CAA4C;CAC3E,CAAC;AAEX,MAAM,UAAU,sBAAsB,CAAC,WAAmB;IACxD,OAAO;QACL;YACE,EAAE,EAAE,UAAU,CAAC,iCAAiC;YAChD,KAAK,EAAE,+CAA+C;YACtD,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,6CAA6C,CAAC;YACtE,YAAY,EAAE;gBACZ;oBACE,IAAI,EAAE,kDAAkD;oBACxD,EAAE,EAA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AAoC,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 editableHtmlPlainTextPaste: 'patch.editable-html-tip-tap.plain-text-paste',\n mathRenderingWrapperMode: 'mode.math-rendering.wrapper',\n preserveRenderUiInlineMenu: 'preserve.render-ui.inline-menu',\n preserveEditableHtmlPlainTextPaste: 'preserve.editable-html-tip-tap.plain-text-paste',\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 id: PRESET_IDS.editableHtmlPlainTextPaste,\n label: '@pie-lib/editable-html-tip-tap pastes external rich text as plain text',\n file: join(\n projectRoot,\n 'packages/lib-react/editable-html-tip-tap/src/components/EditableHtml.tsx'\n ),\n // Each `from` spans the two lines the insertion splits, so a patched file no longer matches.\n // The import is anchored short of the next line's specifier, which gains `.js` only after\n // these patches run. `preserve.editable-html-tip-tap.plain-text-paste` keeps the imported file.\n replacements: [\n {\n from: \"import Placeholder from '@tiptap/extension-placeholder';\\nimport { normalizeInitialMarkup }\",\n to:\n \"import Placeholder from '@tiptap/extension-placeholder';\\n\" +\n \"import { PlainTextPaste } from '../plain-text-paste.js';\\n\" +\n 'import { normalizeInitialMarkup }',\n },\n {\n from: ' TextStyleKit,\\n CharacterCount.configure({',\n to: ' TextStyleKit,\\n PlainTextPaste,\\n CharacterCount.configure({',\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 if (pkgName === 'editable-html-tip-tap') {\n return ['plain-text-paste.ts'];\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",
3
+ "version": "0.1.3-next.20261002220849",
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",
26
+ "@pie-element/element-bundler": "0.1.3-next.20261002215153",
27
27
  "es-module-lexer": "^1.7.0",
28
28
  "glob": "^13.0.0",
29
29
  "open": "^10.0.3",