@pie-lib/mask-markup 3.0.4-next.3 → 3.0.4-next.32

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.
Files changed (107) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +4 -0
  2. package/dist/choices/choice.d.ts +24 -0
  3. package/dist/choices/choice.js +77 -0
  4. package/dist/choices/index.d.ts +25 -0
  5. package/dist/choices/index.js +49 -0
  6. package/dist/componentize.d.ts +12 -0
  7. package/dist/componentize.js +4 -0
  8. package/dist/components/blank.d.ts +39 -0
  9. package/dist/components/blank.js +240 -0
  10. package/dist/components/correct-input.d.ts +11 -0
  11. package/dist/components/dropdown.d.ts +37 -0
  12. package/dist/components/dropdown.js +320 -0
  13. package/dist/components/input.d.ts +37 -0
  14. package/dist/constructed-response.d.ts +44 -0
  15. package/dist/constructed-response.js +55 -0
  16. package/dist/customizable.d.ts +43 -0
  17. package/dist/customizable.js +8 -0
  18. package/dist/drag-in-the-blank.d.ts +37 -0
  19. package/dist/drag-in-the-blank.js +164 -0
  20. package/dist/index.d.ts +15 -0
  21. package/dist/index.js +7 -0
  22. package/dist/inline-dropdown.d.ts +44 -0
  23. package/dist/inline-dropdown.js +24 -0
  24. package/dist/mask.d.ts +30 -0
  25. package/dist/mask.js +99 -0
  26. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  27. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js +17 -0
  28. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js +9 -0
  29. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js +26 -0
  30. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js +11 -0
  31. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js +11 -0
  32. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js +11 -0
  33. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js +24 -0
  34. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixProperties.js +32 -0
  35. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js +29 -0
  36. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js +14 -0
  37. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js +8 -0
  38. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js +12 -0
  39. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js +11 -0
  40. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js +10 -0
  41. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js +10 -0
  42. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js +55 -0
  43. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js +16 -0
  44. package/dist/serialization.d.ts +34 -0
  45. package/dist/serialization.js +132 -0
  46. package/dist/with-mask.d.ts +55 -0
  47. package/dist/with-mask.js +45 -0
  48. package/package.json +39 -20
  49. package/CHANGELOG.json +0 -17
  50. package/CHANGELOG.md +0 -1256
  51. package/LICENSE.md +0 -5
  52. package/lib/choices/choice.js +0 -116
  53. package/lib/choices/choice.js.map +0 -1
  54. package/lib/choices/index.js +0 -103
  55. package/lib/choices/index.js.map +0 -1
  56. package/lib/componentize.js +0 -21
  57. package/lib/componentize.js.map +0 -1
  58. package/lib/components/blank.js +0 -371
  59. package/lib/components/blank.js.map +0 -1
  60. package/lib/components/correct-input.js +0 -94
  61. package/lib/components/correct-input.js.map +0 -1
  62. package/lib/components/dropdown.js +0 -468
  63. package/lib/components/dropdown.js.map +0 -1
  64. package/lib/components/input.js +0 -50
  65. package/lib/components/input.js.map +0 -1
  66. package/lib/constructed-response.js +0 -101
  67. package/lib/constructed-response.js.map +0 -1
  68. package/lib/customizable.js +0 -42
  69. package/lib/customizable.js.map +0 -1
  70. package/lib/drag-in-the-blank.js +0 -254
  71. package/lib/drag-in-the-blank.js.map +0 -1
  72. package/lib/index.js +0 -55
  73. package/lib/index.js.map +0 -1
  74. package/lib/inline-dropdown.js +0 -40
  75. package/lib/inline-dropdown.js.map +0 -1
  76. package/lib/mask.js +0 -198
  77. package/lib/mask.js.map +0 -1
  78. package/lib/serialization.js +0 -261
  79. package/lib/serialization.js.map +0 -1
  80. package/lib/with-mask.js +0 -97
  81. package/lib/with-mask.js.map +0 -1
  82. package/src/__tests__/drag-in-the-blank.test.js +0 -111
  83. package/src/__tests__/index.test.js +0 -38
  84. package/src/__tests__/mask.test.js +0 -381
  85. package/src/__tests__/serialization.test.js +0 -54
  86. package/src/__tests__/utils.js +0 -1
  87. package/src/__tests__/with-mask.test.js +0 -76
  88. package/src/choices/__tests__/index.test.js +0 -75
  89. package/src/choices/choice.jsx +0 -97
  90. package/src/choices/index.jsx +0 -64
  91. package/src/componentize.js +0 -13
  92. package/src/components/__tests__/blank.test.js +0 -169
  93. package/src/components/__tests__/correct-input.test.js +0 -90
  94. package/src/components/__tests__/dropdown.test.js +0 -93
  95. package/src/components/__tests__/input.test.js +0 -102
  96. package/src/components/blank.jsx +0 -386
  97. package/src/components/correct-input.jsx +0 -82
  98. package/src/components/dropdown.jsx +0 -410
  99. package/src/components/input.jsx +0 -48
  100. package/src/constructed-response.jsx +0 -87
  101. package/src/customizable.jsx +0 -34
  102. package/src/drag-in-the-blank.jsx +0 -241
  103. package/src/index.js +0 -16
  104. package/src/inline-dropdown.jsx +0 -29
  105. package/src/mask.jsx +0 -172
  106. package/src/serialization.js +0 -260
  107. package/src/with-mask.jsx +0 -75
package/src/with-mask.jsx DELETED
@@ -1,75 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import Mask from './mask';
4
- import componentize from './componentize';
5
- import { deserialize } from './serialization';
6
-
7
- export const buildLayoutFromMarkup = (markup, type) => {
8
- const { markup: processed } = componentize(markup, type);
9
- const value = deserialize(processed);
10
- return value.document;
11
- };
12
-
13
- export const withMask = (type, renderChildren) => {
14
- return class WithMask extends React.Component {
15
- static propTypes = {
16
- /**
17
- * At the start we'll probably work with markup
18
- */
19
- markup: PropTypes.string,
20
- /**
21
- * Once we start authoring, it may make sense for use to us layout, which will be a simple js object that maps to `slate.Value`.
22
- */
23
- layout: PropTypes.object,
24
- value: PropTypes.object,
25
- onChange: PropTypes.func,
26
- customMarkMarkupComponent: PropTypes.func,
27
- elementType: PropTypes.string,
28
- };
29
-
30
- constructor(props) {
31
- super(props);
32
- this.containerRef = React.createRef();
33
- }
34
-
35
- componentDidUpdate(prevProps) {
36
- if (this.props.markup !== prevProps.markup) {
37
- const domNode = this.containerRef.current;
38
- const mathElements = domNode && domNode.querySelectorAll('[data-latex][data-math-handled="true"]');
39
-
40
- // Clean up for fresh MathJax processing
41
- (mathElements || []).forEach((el) => {
42
- // Remove the MathJax container to allow for clean updates
43
- const mjxContainer = el.querySelector('mjx-container');
44
-
45
- if (mjxContainer) {
46
- el.removeChild(mjxContainer);
47
- }
48
-
49
- // Update the innerHTML to match the raw LaTeX data, ensuring it is reprocessed correctly
50
- const latexCode = el.getAttribute('data-raw');
51
- el.innerHTML = latexCode;
52
-
53
- // Remove the attribute to signal that MathJax should reprocess this element
54
- el.removeAttribute('data-math-handled');
55
- });
56
- }
57
- }
58
-
59
- render() {
60
- const { markup, layout, value, onChange, elementType } = this.props;
61
-
62
- const maskLayout = layout ? layout : buildLayoutFromMarkup(markup, type);
63
- return (
64
- <Mask
65
- containerRef={this.containerRef}
66
- elementType={elementType}
67
- layout={maskLayout}
68
- value={value}
69
- onChange={onChange}
70
- renderChildren={renderChildren(this.props)}
71
- />
72
- );
73
- }
74
- };
75
- };