@pie-lib/mask-markup 3.0.4-next.34 → 3.0.4-next.35

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 (109) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +4 -0
  2. package/dist/choices/choice.d.ts +28 -0
  3. package/dist/choices/choice.js +91 -0
  4. package/dist/choices/index.d.ts +29 -0
  5. package/dist/choices/index.js +59 -0
  6. package/dist/componentize.d.ts +12 -0
  7. package/dist/componentize.js +4 -0
  8. package/dist/components/blank.d.ts +45 -0
  9. package/dist/components/blank.js +273 -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 +311 -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 +56 -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 +47 -0
  19. package/dist/drag-in-the-blank.js +220 -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/keyboard-coordinates.d.ts +25 -0
  25. package/dist/keyboard-coordinates.js +49 -0
  26. package/dist/mask.d.ts +30 -0
  27. package/dist/mask.js +95 -0
  28. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
  29. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js +17 -0
  30. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js +9 -0
  31. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js +26 -0
  32. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js +11 -0
  33. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js +11 -0
  34. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js +11 -0
  35. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js +24 -0
  36. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixProperties.js +32 -0
  37. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js +29 -0
  38. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js +14 -0
  39. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js +8 -0
  40. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js +12 -0
  41. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js +11 -0
  42. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js +10 -0
  43. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js +10 -0
  44. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js +55 -0
  45. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js +16 -0
  46. package/dist/serialization.d.ts +34 -0
  47. package/dist/serialization.js +132 -0
  48. package/dist/with-mask.d.ts +55 -0
  49. package/dist/with-mask.js +45 -0
  50. package/package.json +43 -20
  51. package/CHANGELOG.json +0 -17
  52. package/CHANGELOG.md +0 -1256
  53. package/LICENSE.md +0 -5
  54. package/lib/choices/choice.js +0 -116
  55. package/lib/choices/choice.js.map +0 -1
  56. package/lib/choices/index.js +0 -103
  57. package/lib/choices/index.js.map +0 -1
  58. package/lib/componentize.js +0 -21
  59. package/lib/componentize.js.map +0 -1
  60. package/lib/components/blank.js +0 -371
  61. package/lib/components/blank.js.map +0 -1
  62. package/lib/components/correct-input.js +0 -94
  63. package/lib/components/correct-input.js.map +0 -1
  64. package/lib/components/dropdown.js +0 -483
  65. package/lib/components/dropdown.js.map +0 -1
  66. package/lib/components/input.js +0 -50
  67. package/lib/components/input.js.map +0 -1
  68. package/lib/constructed-response.js +0 -101
  69. package/lib/constructed-response.js.map +0 -1
  70. package/lib/customizable.js +0 -42
  71. package/lib/customizable.js.map +0 -1
  72. package/lib/drag-in-the-blank.js +0 -254
  73. package/lib/drag-in-the-blank.js.map +0 -1
  74. package/lib/index.js +0 -55
  75. package/lib/index.js.map +0 -1
  76. package/lib/inline-dropdown.js +0 -40
  77. package/lib/inline-dropdown.js.map +0 -1
  78. package/lib/mask.js +0 -198
  79. package/lib/mask.js.map +0 -1
  80. package/lib/serialization.js +0 -261
  81. package/lib/serialization.js.map +0 -1
  82. package/lib/with-mask.js +0 -97
  83. package/lib/with-mask.js.map +0 -1
  84. package/src/__tests__/drag-in-the-blank.test.js +0 -111
  85. package/src/__tests__/index.test.js +0 -38
  86. package/src/__tests__/mask.test.js +0 -381
  87. package/src/__tests__/serialization.test.js +0 -54
  88. package/src/__tests__/utils.js +0 -1
  89. package/src/__tests__/with-mask.test.js +0 -76
  90. package/src/choices/__tests__/index.test.js +0 -75
  91. package/src/choices/choice.jsx +0 -97
  92. package/src/choices/index.jsx +0 -64
  93. package/src/componentize.js +0 -13
  94. package/src/components/__tests__/blank.test.js +0 -199
  95. package/src/components/__tests__/correct-input.test.js +0 -90
  96. package/src/components/__tests__/dropdown.test.js +0 -129
  97. package/src/components/__tests__/input.test.js +0 -102
  98. package/src/components/blank.jsx +0 -386
  99. package/src/components/correct-input.jsx +0 -82
  100. package/src/components/dropdown.jsx +0 -423
  101. package/src/components/input.jsx +0 -48
  102. package/src/constructed-response.jsx +0 -87
  103. package/src/customizable.jsx +0 -34
  104. package/src/drag-in-the-blank.jsx +0 -241
  105. package/src/index.js +0 -16
  106. package/src/inline-dropdown.jsx +0 -29
  107. package/src/mask.jsx +0 -172
  108. package/src/serialization.js +0 -260
  109. 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
- };