@pie-lib/mask-markup 3.0.4-next.0 → 3.0.4-next.102

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 (106) hide show
  1. package/CHANGELOG.json +17 -0
  2. package/CHANGELOG.md +1256 -0
  3. package/LICENSE.md +5 -0
  4. package/lib/choices/choice.js +117 -0
  5. package/lib/choices/choice.js.map +1 -0
  6. package/lib/choices/index.js +103 -0
  7. package/lib/choices/index.js.map +1 -0
  8. package/lib/componentize.js +21 -0
  9. package/lib/componentize.js.map +1 -0
  10. package/lib/components/blank.js +409 -0
  11. package/lib/components/blank.js.map +1 -0
  12. package/lib/components/correct-input.js +94 -0
  13. package/lib/components/correct-input.js.map +1 -0
  14. package/lib/components/dropdown.js +483 -0
  15. package/lib/components/dropdown.js.map +1 -0
  16. package/lib/components/input.js +50 -0
  17. package/lib/components/input.js.map +1 -0
  18. package/lib/constructed-response.js +101 -0
  19. package/lib/constructed-response.js.map +1 -0
  20. package/lib/customizable.js +42 -0
  21. package/lib/customizable.js.map +1 -0
  22. package/lib/drag-in-the-blank.js +254 -0
  23. package/lib/drag-in-the-blank.js.map +1 -0
  24. package/lib/index.js +55 -0
  25. package/lib/index.js.map +1 -0
  26. package/lib/inline-dropdown.js +40 -0
  27. package/lib/inline-dropdown.js.map +1 -0
  28. package/lib/mask.js +198 -0
  29. package/lib/mask.js.map +1 -0
  30. package/lib/serialization.js +261 -0
  31. package/lib/serialization.js.map +1 -0
  32. package/lib/with-mask.js +97 -0
  33. package/lib/with-mask.js.map +1 -0
  34. package/package.json +17 -35
  35. package/src/__tests__/drag-in-the-blank.test.js +111 -0
  36. package/src/__tests__/index.test.js +38 -0
  37. package/src/__tests__/mask.test.js +381 -0
  38. package/src/__tests__/serialization.test.js +54 -0
  39. package/src/__tests__/utils.js +1 -0
  40. package/src/__tests__/with-mask.test.js +76 -0
  41. package/src/choices/__tests__/index.test.js +75 -0
  42. package/src/choices/choice.jsx +97 -0
  43. package/src/choices/index.jsx +64 -0
  44. package/src/componentize.js +13 -0
  45. package/src/components/__tests__/blank.test.js +199 -0
  46. package/src/components/__tests__/correct-input.test.js +90 -0
  47. package/src/components/__tests__/dropdown.test.js +129 -0
  48. package/src/components/__tests__/input.test.js +102 -0
  49. package/src/components/blank.jsx +429 -0
  50. package/src/components/correct-input.jsx +82 -0
  51. package/src/components/dropdown.jsx +423 -0
  52. package/src/components/input.jsx +48 -0
  53. package/src/constructed-response.jsx +87 -0
  54. package/src/customizable.jsx +34 -0
  55. package/src/drag-in-the-blank.jsx +241 -0
  56. package/src/index.js +16 -0
  57. package/src/inline-dropdown.jsx +29 -0
  58. package/src/mask.jsx +172 -0
  59. package/src/serialization.js +260 -0
  60. package/src/with-mask.jsx +75 -0
  61. package/dist/_virtual/_rolldown/runtime.js +0 -4
  62. package/dist/choices/choice.d.ts +0 -24
  63. package/dist/choices/choice.js +0 -77
  64. package/dist/choices/index.d.ts +0 -25
  65. package/dist/choices/index.js +0 -49
  66. package/dist/componentize.d.ts +0 -12
  67. package/dist/componentize.js +0 -4
  68. package/dist/components/blank.d.ts +0 -39
  69. package/dist/components/blank.js +0 -240
  70. package/dist/components/correct-input.d.ts +0 -11
  71. package/dist/components/dropdown.d.ts +0 -37
  72. package/dist/components/dropdown.js +0 -320
  73. package/dist/components/input.d.ts +0 -37
  74. package/dist/constructed-response.d.ts +0 -44
  75. package/dist/constructed-response.js +0 -55
  76. package/dist/customizable.d.ts +0 -43
  77. package/dist/customizable.js +0 -8
  78. package/dist/drag-in-the-blank.d.ts +0 -37
  79. package/dist/drag-in-the-blank.js +0 -164
  80. package/dist/index.d.ts +0 -15
  81. package/dist/index.js +0 -7
  82. package/dist/inline-dropdown.d.ts +0 -44
  83. package/dist/inline-dropdown.js +0 -24
  84. package/dist/mask.d.ts +0 -30
  85. package/dist/mask.js +0 -99
  86. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/index.js +0 -17
  87. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssPrefix.js +0 -9
  88. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/cssUnitless.js +0 -26
  89. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/hasOwn.js +0 -11
  90. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isFunction.js +0 -11
  91. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/isObject.js +0 -11
  92. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixInfo.js +0 -24
  93. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixProperties.js +0 -32
  94. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/prefixer.js +0 -29
  95. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/camelize.js +0 -14
  96. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenRe.js +0 -8
  97. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/hyphenate.js +0 -12
  98. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/separate.js +0 -11
  99. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toLowerFirst.js +0 -10
  100. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/stringUtils/toUpperFirst.js +0 -10
  101. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleObject.js +0 -55
  102. package/dist/node_modules/.bun/to-style@1.3.3/node_modules/to-style/src/toStyleString.js +0 -16
  103. package/dist/serialization.d.ts +0 -34
  104. package/dist/serialization.js +0 -132
  105. package/dist/with-mask.d.ts +0 -55
  106. package/dist/with-mask.js +0 -45
package/LICENSE.md ADDED
@@ -0,0 +1,5 @@
1
+ Copyright 2019 CoreSpring Inc
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
4
+
5
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.DRAG_TYPE = void 0;
9
+ exports["default"] = Choice;
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var _propTypes = _interopRequireDefault(require("prop-types"));
14
+ var _core = require("@dnd-kit/core");
15
+ var _styles = require("@mui/material/styles");
16
+ var _Chip = _interopRequireDefault(require("@mui/material/Chip"));
17
+ var _mathRendering = require("@pie-lib/math-rendering");
18
+ var _renderUi = require("@pie-lib/render-ui");
19
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
+ var DRAG_TYPE = exports.DRAG_TYPE = 'MaskBlank';
23
+ var StyledChoice = (0, _styles.styled)('span')(function (_ref) {
24
+ var theme = _ref.theme,
25
+ disabled = _ref.disabled;
26
+ return _objectSpread({
27
+ border: "solid 0px ".concat(theme.palette.primary.main),
28
+ borderRadius: theme.spacing(2),
29
+ margin: theme.spacing(0.5),
30
+ transform: 'translate(0, 0)',
31
+ display: 'inline-flex'
32
+ }, disabled && {});
33
+ });
34
+ var StyledChip = (0, _styles.styled)(_Chip["default"])(function () {
35
+ return {
36
+ backgroundColor: _renderUi.color.white(),
37
+ border: "1px solid ".concat(_renderUi.color.text()),
38
+ color: _renderUi.color.text(),
39
+ alignItems: 'center',
40
+ display: 'inline-flex',
41
+ height: 'initial',
42
+ minHeight: '32px',
43
+ fontSize: 'inherit',
44
+ whiteSpace: 'pre-wrap',
45
+ maxWidth: '374px',
46
+ // Added for touch devices, for image content.
47
+ // This will prevent the context menu from appearing and not allowing other interactions with the image.
48
+ // If interactions with the image in the token will be requested we should handle only the context Menu.
49
+ pointerEvents: 'none',
50
+ borderRadius: '3px',
51
+ paddingTop: '12px',
52
+ paddingBottom: '12px',
53
+ '&.Mui-disabled': {
54
+ opacity: 1
55
+ }
56
+ };
57
+ });
58
+ var StyledChipLabel = (0, _styles.styled)('span')(function () {
59
+ return {
60
+ whiteSpace: 'normal',
61
+ '& img': {
62
+ display: 'block',
63
+ padding: '2px 0'
64
+ },
65
+ '& mjx-frac': {
66
+ fontSize: '120% !important'
67
+ }
68
+ };
69
+ });
70
+ function Choice(_ref2) {
71
+ var _rootRef$current, _rootRef$current2;
72
+ var choice = _ref2.choice,
73
+ disabled = _ref2.disabled,
74
+ instanceId = _ref2.instanceId;
75
+ var rootRef = (0, _react.useRef)(null);
76
+ var _useDraggable = (0, _core.useDraggable)({
77
+ id: "choice-".concat(choice.id),
78
+ data: {
79
+ choice: choice,
80
+ instanceId: instanceId,
81
+ fromChoice: true,
82
+ type: DRAG_TYPE
83
+ },
84
+ disabled: disabled
85
+ }),
86
+ attributes = _useDraggable.attributes,
87
+ listeners = _useDraggable.listeners,
88
+ setNodeRef = _useDraggable.setNodeRef,
89
+ isDragging = _useDraggable.isDragging;
90
+ (0, _react.useEffect)(function () {
91
+ (0, _mathRendering.renderMath)(rootRef.current);
92
+ }, [choice.value]);
93
+ return /*#__PURE__*/_react["default"].createElement(StyledChoice, (0, _extends2["default"])({
94
+ ref: setNodeRef,
95
+ style: isDragging ? {
96
+ width: ((_rootRef$current = rootRef.current) === null || _rootRef$current === void 0 ? void 0 : _rootRef$current.offsetWidth) || 90,
97
+ // min-width of chip is 90px, so if we don't have the width, we can use 90px as a fallback
98
+ height: ((_rootRef$current2 = rootRef.current) === null || _rootRef$current2 === void 0 ? void 0 : _rootRef$current2.offsetHeight) || 32 // min-height of chip is 32px, so if we don't have the height, we can use 32px as a fallback
99
+ } : {},
100
+ disabled: disabled
101
+ }, listeners, attributes), /*#__PURE__*/_react["default"].createElement(StyledChip, {
102
+ clickable: false,
103
+ disabled: disabled,
104
+ ref: rootRef,
105
+ label: /*#__PURE__*/_react["default"].createElement(StyledChipLabel, {
106
+ dangerouslySetInnerHTML: {
107
+ __html: choice.value
108
+ }
109
+ })
110
+ }));
111
+ }
112
+ Choice.propTypes = {
113
+ choice: _propTypes["default"].object.isRequired,
114
+ disabled: _propTypes["default"].bool,
115
+ instanceId: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number])
116
+ };
117
+ //# sourceMappingURL=choice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_core","_styles","_Chip","_mathRendering","_renderUi","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","DRAG_TYPE","exports","StyledChoice","styled","_ref","theme","disabled","border","concat","palette","primary","main","borderRadius","spacing","margin","transform","display","StyledChip","Chip","backgroundColor","color","white","text","alignItems","height","minHeight","fontSize","whiteSpace","maxWidth","pointerEvents","paddingTop","paddingBottom","opacity","StyledChipLabel","padding","Choice","_ref2","_rootRef$current","_rootRef$current2","choice","instanceId","rootRef","useRef","_useDraggable","useDraggable","id","data","fromChoice","type","attributes","listeners","setNodeRef","isDragging","useEffect","renderMath","current","value","createElement","_extends2","ref","style","width","offsetWidth","offsetHeight","clickable","label","dangerouslySetInnerHTML","__html","propTypes","PropTypes","object","isRequired","bool","oneOfType","string","number"],"sources":["../../src/choices/choice.jsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { useDraggable } from '@dnd-kit/core';\nimport { styled } from '@mui/material/styles';\nimport Chip from '@mui/material/Chip';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { color } from '@pie-lib/render-ui';\n\nexport const DRAG_TYPE = 'MaskBlank';\n\nconst StyledChoice = styled('span')(({ theme, disabled }) => ({\n border: `solid 0px ${theme.palette.primary.main}`,\n borderRadius: theme.spacing(2),\n margin: theme.spacing(0.5),\n transform: 'translate(0, 0)',\n display: 'inline-flex',\n ...(disabled && {}),\n}));\n\nconst StyledChip = styled(Chip)(() => ({\n backgroundColor: color.white(),\n border: `1px solid ${color.text()}`,\n color: color.text(),\n alignItems: 'center',\n display: 'inline-flex',\n height: 'initial',\n minHeight: '32px',\n fontSize: 'inherit',\n whiteSpace: 'pre-wrap',\n maxWidth: '374px',\n // Added for touch devices, for image content.\n // This will prevent the context menu from appearing and not allowing other interactions with the image.\n // If interactions with the image in the token will be requested we should handle only the context Menu.\n pointerEvents: 'none',\n borderRadius: '3px',\n paddingTop: '12px',\n paddingBottom: '12px',\n\n '&.Mui-disabled': {\n opacity: 1,\n },\n}));\n\nconst StyledChipLabel = styled('span')(() => ({\n whiteSpace: 'normal',\n '& img': {\n display: 'block',\n padding: '2px 0',\n },\n '& mjx-frac': {\n fontSize: '120% !important',\n },\n}));\n\nexport default function Choice({ choice, disabled, instanceId }) {\n const rootRef = useRef(null);\n\n const { attributes, listeners, setNodeRef, isDragging } = useDraggable({\n id: `choice-${choice.id}`,\n data: { choice, instanceId, fromChoice: true, type: DRAG_TYPE },\n disabled,\n });\n\n useEffect(() => {\n renderMath(rootRef.current);\n }, [choice.value]);\n\n return (\n <StyledChoice\n ref={setNodeRef}\n style={\n isDragging\n ? {\n width: rootRef.current?.offsetWidth || 90, // min-width of chip is 90px, so if we don't have the width, we can use 90px as a fallback\n height: rootRef.current?.offsetHeight || 32, // min-height of chip is 32px, so if we don't have the height, we can use 32px as a fallback\n }\n : {}\n }\n disabled={disabled}\n {...listeners}\n {...attributes}\n >\n <StyledChip\n clickable={false}\n disabled={disabled}\n ref={rootRef}\n label={<StyledChipLabel dangerouslySetInnerHTML={{ __html: choice.value }} />}\n />\n </StyledChoice>\n );\n}\n\nChoice.propTypes = {\n choice: PropTypes.object.isRequired,\n disabled: PropTypes.bool,\n instanceId: PropTypes.oneOfType([PropTyp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ACD,CAAC,CACN;IACDzD,QAAQ,EAAEA;EAAS,GACf4C,SAAS,EACTD,UAAU,gBAEd7F,MAAA,YAAAqG,aAAA,CAACxC,UAAU;IACT+C,SAAS,EAAE,KAAM;IACjB1D,QAAQ,EAAEA,QAAS;IACnBqD,GAAG,EAAElB,OAAQ;IACbwB,KAAK,eAAE7G,MAAA,YAAAqG,aAAA,CAACxB,eAAe;MAACiC,uBAAuB,EAAE;QAAEC,MAAM,EAAE5B,MAAM,CAACiB;MAAM;IAAE,CAAE;EAAE,CAC/E,CACW,CAAC;AAEnB;AAEArB,MAAM,CAACiC,SAAS,GAAG;EACjB7B,MAAM,EAAE8B,qBAAS,CAACC,MAAM,CAACC,UAAU;EACnCjE,QAAQ,EAAE+D,qBAAS,CAACG,IAAI;EACxBhC,UAAU,EAAE6B,qBAAS,CAACI,SAAS,CAAC,CAACJ,qBAAS,CAACK,MAAM,EAAEL,qBAAS,CAACM,MAAM,CAAC;AACtE,CAAC","ignoreList":[]}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+ var _react = _interopRequireDefault(require("react"));
15
+ var _propTypes = _interopRequireDefault(require("prop-types"));
16
+ var _lodashEs = require("lodash-es");
17
+ var _choice = _interopRequireDefault(require("./choice"));
18
+ var _drag = require("@pie-lib/drag");
19
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
22
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
23
+ var Choices = exports["default"] = /*#__PURE__*/function (_React$Component) {
24
+ function Choices() {
25
+ var _this;
26
+ (0, _classCallCheck2["default"])(this, Choices);
27
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
+ args[_key] = arguments[_key];
29
+ }
30
+ _this = _callSuper(this, Choices, [].concat(args));
31
+ (0, _defineProperty2["default"])(_this, "getStyleForWrapper", function () {
32
+ var choicePosition = _this.props.choicePosition;
33
+ switch (choicePosition) {
34
+ case 'above':
35
+ return {
36
+ margin: '0 0 40px 0'
37
+ };
38
+ case 'below':
39
+ return {
40
+ margin: '40px 0 0 0'
41
+ };
42
+ case 'right':
43
+ return {
44
+ margin: '0 0 0 40px'
45
+ };
46
+ default:
47
+ return {
48
+ margin: '0 40px 0 0'
49
+ };
50
+ }
51
+ });
52
+ return _this;
53
+ }
54
+ (0, _inherits2["default"])(Choices, _React$Component);
55
+ return (0, _createClass2["default"])(Choices, [{
56
+ key: "render",
57
+ value: function render() {
58
+ var _this$props = this.props,
59
+ disabled = _this$props.disabled,
60
+ duplicates = _this$props.duplicates,
61
+ choices = _this$props.choices,
62
+ value = _this$props.value,
63
+ instanceId = _this$props.instanceId;
64
+ var filteredChoices = choices.filter(function (c) {
65
+ if (duplicates === true) {
66
+ return true;
67
+ }
68
+ var foundChoice = (0, _lodashEs.findKey)(value, function (v) {
69
+ return v === c.id;
70
+ });
71
+ return foundChoice === undefined;
72
+ });
73
+ var elementStyle = _objectSpread(_objectSpread({}, this.getStyleForWrapper()), {}, {
74
+ minWidth: '100px'
75
+ });
76
+ return /*#__PURE__*/_react["default"].createElement("div", {
77
+ style: elementStyle
78
+ }, /*#__PURE__*/_react["default"].createElement(_drag.DragDroppablePlaceholder, {
79
+ disabled: disabled,
80
+ instanceId: instanceId
81
+ }, filteredChoices.map(function (c, index) {
82
+ return /*#__PURE__*/_react["default"].createElement(_choice["default"], {
83
+ key: "".concat(c.value, "-").concat(index),
84
+ disabled: disabled,
85
+ choice: c,
86
+ instanceId: instanceId
87
+ });
88
+ })));
89
+ }
90
+ }]);
91
+ }(_react["default"].Component);
92
+ (0, _defineProperty2["default"])(Choices, "propTypes", {
93
+ disabled: _propTypes["default"].bool,
94
+ duplicates: _propTypes["default"].bool,
95
+ choices: _propTypes["default"].arrayOf(_propTypes["default"].shape({
96
+ label: _propTypes["default"].string,
97
+ value: _propTypes["default"].string
98
+ })),
99
+ value: _propTypes["default"].object,
100
+ choicePosition: _propTypes["default"].string.isRequired,
101
+ instanceId: _propTypes["default"].string // Added for drag isolation
102
+ });
103
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodashEs","_choice","_drag","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","Boolean","prototype","valueOf","call","Choices","exports","_React$Component","_this","_classCallCheck2","_len","args","Array","_key","concat","choicePosition","props","margin","_inherits2","_createClass2","key","value","render","_this$props","disabled","duplicates","choices","instanceId","filteredChoices","c","foundChoice","findKey","v","id","undefined","elementStyle","getStyleForWrapper","minWidth","createElement","style","DragDroppablePlaceholder","map","index","choice","React","Component","PropTypes","bool","arrayOf","shape","label","string","object","isRequired"],"sources":["../../src/choices/index.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { findKey } from 'lodash-es';\nimport Choice from './choice';\nimport { DragDroppablePlaceholder } from '@pie-lib/drag';\n\nexport default class Choices extends React.Component {\n static propTypes = {\n disabled: PropTypes.bool,\n duplicates: PropTypes.bool,\n choices: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string, value: PropTypes.string })),\n value: PropTypes.object,\n choicePosition: PropTypes.string.isRequired,\n instanceId: PropTypes.string, // Added for drag isolation\n };\n\n getStyleForWrapper = () => {\n const { choicePosition } = this.props;\n\n switch (choicePosition) {\n case 'above':\n return {\n margin: '0 0 40px 0',\n };\n\n case 'below':\n return {\n margin: '40px 0 0 0',\n };\n\n case 'right':\n return {\n margin: '0 0 0 40px',\n };\n\n default:\n return {\n margin: '0 40px 0 0',\n };\n }\n };\n\n render() {\n const { disabled, duplicates, choices, value, instanceId } = this.props;\n const filteredChoices = choices.filter((c) => {\n if (duplicates === true) {\n return true;\n }\n const foundChoice = findKey(value, (v) => v === c.id);\n return foundChoice === undefined;\n });\n const elementStyle = { ...this.getStyleForWrapper(), minWidth: '100px' };\n\n return (\n <div style={elementStyle}>\n <DragDroppablePlaceholder disabled={disabled} instanceId={instanceId}>\n {filteredChoices.map((c, index) => (\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ACiD,GAAG,KAAAN,MAAA,CAAKe,CAAC,CAACR,KAAK,OAAAP,MAAA,CAAI4B,KAAK,CAAG;UAAClB,QAAQ,EAAEA,QAAS;UAACmB,MAAM,EAAEd,CAAE;UAACF,UAAU,EAAEA;QAAW,CAAE,CAAC;MAAA,CAC9F,CACuB,CACvB,CAAC;IAEV;EAAC;AAAA,EAxDkCiB,iBAAK,CAACC,SAAS;AAAA,IAAAvD,gBAAA,aAA/Be,OAAO,eACP;EACjBmB,QAAQ,EAAEsB,qBAAS,CAACC,IAAI;EACxBtB,UAAU,EAAEqB,qBAAS,CAACC,IAAI;EAC1BrB,OAAO,EAAEoB,qBAAS,CAACE,OAAO,CAACF,qBAAS,CAACG,KAAK,CAAC;IAAEC,KAAK,EAAEJ,qBAAS,CAACK,MAAM;IAAE9B,KAAK,EAAEyB,qBAAS,CAACK;EAAO,CAAC,CAAC,CAAC;EACjG9B,KAAK,EAAEyB,qBAAS,CAACM,MAAM;EACvBrC,cAAc,EAAE+B,qBAAS,CAACK,MAAM,CAACE,UAAU;EAC3C1B,UAAU,EAAEmB,qBAAS,CAACK,MAAM,CAAE;AAChC,CAAC","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var REGEX = /\{\{(\d+)\}\}/g;
8
+ var _default = exports["default"] = function _default(s, t) {
9
+ if (!s) {
10
+ return {
11
+ markup: ''
12
+ };
13
+ }
14
+ var markup = s.replace(REGEX, function (match, g) {
15
+ return "<span data-component=\"".concat(t, "\" data-id=\"").concat(g, "\"></span>");
16
+ });
17
+ return {
18
+ markup: markup
19
+ };
20
+ };
21
+ //# sourceMappingURL=componentize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentize.js","names":["REGEX","_default","exports","s","t","markup","replace","match","g","concat"],"sources":["../src/componentize.js"],"sourcesContent":["const REGEX = /\\{\\{(\\d+)\\}\\}/g;\n\nexport default (s, t) => {\n if (!s) {\n return { markup: '' };\n }\n\n const markup = s.replace(REGEX, (match, g) => {\n return `<span data-component=\"${t}\" data-id=\"${g}\"></span>`;\n });\n\n return { markup };\n};\n"],"mappings":";;;;;;AAAA,IAAMA,KAAK,GAAG,gBAAgB;AAAC,IAAAC,QAAA,GAAAC,OAAA,cAEhB,SAAAD,SAACE,CAAC,EAAEC,CAAC,EAAK;EACvB,IAAI,CAACD,CAAC,EAAE;IACN,OAAO;MAAEE,MAAM,EAAE;IAAG,CAAC;EACvB;EAEA,IAAMA,MAAM,GAAGF,CAAC,CAACG,OAAO,CAACN,KAAK,EAAE,UAACO,KAAK,EAAEC,CAAC,EAAK;IAC5C,iCAAAC,MAAA,CAAgCL,CAAC,mBAAAK,MAAA,CAAcD,CAAC;EAClD,CAAC,CAAC;EAEF,OAAO;IAAEH,MAAM,EAANA;EAAO,CAAC;AACnB,CAAC","ignoreList":[]}