@elice/material-quiz 1.261020.0-materialquizeditsetvalue.0 → 1.261022.0

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.
@@ -36,14 +36,6 @@ function _asyncToGenerator(n) {
36
36
  });
37
37
  };
38
38
  }
39
- function _defineProperty(e, r, t) {
40
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
41
- value: t,
42
- enumerable: true,
43
- configurable: true,
44
- writable: true
45
- }) : e[r] = t, e;
46
- }
47
39
  function _iterableToArray(r) {
48
40
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
49
41
  }
@@ -201,20 +193,6 @@ function _taggedTemplateLiteral(e, t) {
201
193
  function _toConsumableArray(r) {
202
194
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
203
195
  }
204
- function _toPrimitive(t, r) {
205
- if ("object" != typeof t || !t) return t;
206
- var e = t[Symbol.toPrimitive];
207
- if (void 0 !== e) {
208
- var i = e.call(t, r);
209
- if ("object" != typeof i) return i;
210
- throw new TypeError("@@toPrimitive must return a primitive value.");
211
- }
212
- return ("string" === r ? String : Number)(t);
213
- }
214
- function _toPropertyKey(t) {
215
- var i = _toPrimitive(t, "string");
216
- return "symbol" == typeof i ? i : i + "";
217
- }
218
196
  function _typeof(o) {
219
197
  "@babel/helpers - typeof";
220
198
 
@@ -236,7 +214,6 @@ exports.arrayLikeToArray = _arrayLikeToArray;
236
214
  exports.arrayWithHoles = _arrayWithHoles;
237
215
  exports.arrayWithoutHoles = _arrayWithoutHoles;
238
216
  exports.asyncToGenerator = _asyncToGenerator;
239
- exports.defineProperty = _defineProperty;
240
217
  exports.iterableToArray = _iterableToArray;
241
218
  exports.iterableToArrayLimit = _iterableToArrayLimit;
242
219
  exports.nonIterableRest = _nonIterableRest;
@@ -246,7 +223,5 @@ exports.regeneratorDefine = _regeneratorDefine;
246
223
  exports.slicedToArray = _slicedToArray;
247
224
  exports.taggedTemplateLiteral = _taggedTemplateLiteral;
248
225
  exports.toConsumableArray = _toConsumableArray;
249
- exports.toPrimitive = _toPrimitive;
250
- exports.toPropertyKey = _toPropertyKey;
251
226
  exports.typeof = _typeof;
252
227
  exports.unsupportedIterableToArray = _unsupportedIterableToArray;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { MarkdownEditorFileUploadReqFn } from '@elice/markdown';
3
3
  import type { GetOrgMaterialQuizGetResponses } from '@elice/types';
4
- import type { FormState, UseFormSetValue } from 'react-hook-form';
4
+ import type { FormState } from 'react-hook-form';
5
5
  import type { MaterialQuizApiProviderProps } from '../shared';
6
6
  export type MaterialQuizEditValue = Pick<GetOrgMaterialQuizGetResponses['materialQuiz'], 'id' | 'questionTitle' | 'questionDescription' | 'optionType' | 'optionsDefault' | 'answerInfoDefault' | 'answerHint' | 'isAutoGrade' | 'explanationInfo' | 'groups' | 'optionsSetEnabled' | 'answerTextType'>;
7
7
  export type MaterialQuizEditFormState = Pick<FormState<Record<string, any>>, 'isDirty' | 'isValid'>;
@@ -20,13 +20,7 @@ export interface MaterialQuizEditProps extends MaterialQuizApiProviderProps {
20
20
  /** Handle file upload. */
21
21
  onFileUploadRequest: MarkdownEditorFileUploadReqFn;
22
22
  }
23
- export interface MaterialQuizEditRef extends HTMLFormElement {
24
- /** Reset the form to `value`, which becomes the new default (not dirty). */
25
- reset: () => void;
26
- /** Set a field value like react-hook-form's `setValue`, keeping the default values. */
27
- setValue: UseFormSetValue<MaterialQuizEditValue>;
28
- }
29
23
  declare const _default: React.ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<MaterialQuizEditProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
30
24
  __intl: import("@elice/intl").EliceIntlShape;
31
- } & React.RefAttributes<MaterialQuizEditRef>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<MaterialQuizEditRef>>;
25
+ } & React.RefAttributes<HTMLFormElement>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<HTMLFormElement>>;
32
26
  export default _default;
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
5
  var jsxRuntime = require('react/jsx-runtime');
7
6
  var React = require('react');
8
7
  var reactHookForm = require('react-hook-form');
@@ -79,10 +78,6 @@ var MaterialQuizEdit = React.forwardRef(function (_ref, ref) {
79
78
  reset: function reset() {
80
79
  useFormMethods.reset(editValue.manipulateValue(value));
81
80
  void useFormMethods.trigger();
82
- },
83
- setValue: function setValue(name, fieldValue, options) {
84
- var formValue = name === 'optionsDefault' || name === 'groups' ? editValue.manipulateValue(Object.assign(Object.assign({}, value), _rollupPluginBabelHelpers.defineProperty({}, name, fieldValue)))[name] : fieldValue;
85
- useFormMethods.setValue(name, formValue, options);
86
81
  }
87
82
  });
88
83
  }, [useFormMethods, value]);
@@ -1,2 +1,2 @@
1
1
  export { default as MaterialQuizEdit } from './MaterialQuizEdit';
2
- export type { MaterialQuizEditProps, MaterialQuizEditFormState, MaterialQuizEditRef, MaterialQuizEditValue, } from './MaterialQuizEdit';
2
+ export type { MaterialQuizEditProps, MaterialQuizEditFormState, MaterialQuizEditValue, } from './MaterialQuizEdit';
@@ -34,14 +34,6 @@ function _asyncToGenerator(n) {
34
34
  });
35
35
  };
36
36
  }
37
- function _defineProperty(e, r, t) {
38
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
39
- value: t,
40
- enumerable: true,
41
- configurable: true,
42
- writable: true
43
- }) : e[r] = t, e;
44
- }
45
37
  function _iterableToArray(r) {
46
38
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
47
39
  }
@@ -199,20 +191,6 @@ function _taggedTemplateLiteral(e, t) {
199
191
  function _toConsumableArray(r) {
200
192
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
201
193
  }
202
- function _toPrimitive(t, r) {
203
- if ("object" != typeof t || !t) return t;
204
- var e = t[Symbol.toPrimitive];
205
- if (void 0 !== e) {
206
- var i = e.call(t, r);
207
- if ("object" != typeof i) return i;
208
- throw new TypeError("@@toPrimitive must return a primitive value.");
209
- }
210
- return ("string" === r ? String : Number)(t);
211
- }
212
- function _toPropertyKey(t) {
213
- var i = _toPrimitive(t, "string");
214
- return "symbol" == typeof i ? i : i + "";
215
- }
216
194
  function _typeof(o) {
217
195
  "@babel/helpers - typeof";
218
196
 
@@ -230,4 +208,4 @@ function _unsupportedIterableToArray(r, a) {
230
208
  }
231
209
  }
232
210
 
233
- export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _asyncToGenerator as asyncToGenerator, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _regenerator as regenerator, _regeneratorDefine as regeneratorDefine, _slicedToArray as slicedToArray, _taggedTemplateLiteral as taggedTemplateLiteral, _toConsumableArray as toConsumableArray, _toPrimitive as toPrimitive, _toPropertyKey as toPropertyKey, _typeof as typeof, _unsupportedIterableToArray as unsupportedIterableToArray };
211
+ export { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _asyncToGenerator as asyncToGenerator, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _regenerator as regenerator, _regeneratorDefine as regeneratorDefine, _slicedToArray as slicedToArray, _taggedTemplateLiteral as taggedTemplateLiteral, _toConsumableArray as toConsumableArray, _typeof as typeof, _unsupportedIterableToArray as unsupportedIterableToArray };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { MarkdownEditorFileUploadReqFn } from '@elice/markdown';
3
3
  import type { GetOrgMaterialQuizGetResponses } from '@elice/types';
4
- import type { FormState, UseFormSetValue } from 'react-hook-form';
4
+ import type { FormState } from 'react-hook-form';
5
5
  import type { MaterialQuizApiProviderProps } from '../shared';
6
6
  export type MaterialQuizEditValue = Pick<GetOrgMaterialQuizGetResponses['materialQuiz'], 'id' | 'questionTitle' | 'questionDescription' | 'optionType' | 'optionsDefault' | 'answerInfoDefault' | 'answerHint' | 'isAutoGrade' | 'explanationInfo' | 'groups' | 'optionsSetEnabled' | 'answerTextType'>;
7
7
  export type MaterialQuizEditFormState = Pick<FormState<Record<string, any>>, 'isDirty' | 'isValid'>;
@@ -20,13 +20,7 @@ export interface MaterialQuizEditProps extends MaterialQuizApiProviderProps {
20
20
  /** Handle file upload. */
21
21
  onFileUploadRequest: MarkdownEditorFileUploadReqFn;
22
22
  }
23
- export interface MaterialQuizEditRef extends HTMLFormElement {
24
- /** Reset the form to `value`, which becomes the new default (not dirty). */
25
- reset: () => void;
26
- /** Set a field value like react-hook-form's `setValue`, keeping the default values. */
27
- setValue: UseFormSetValue<MaterialQuizEditValue>;
28
- }
29
23
  declare const _default: React.ForwardRefExoticComponent<Omit<import("@elice/intl").IntlComponentExtraProps & Omit<import("@elice/intl").IntlComponentExtraProps & Omit<MaterialQuizEditProps, keyof import("@elice/intl").IntlComponentExtraProps | "__intl"> & {
30
24
  __intl: import("@elice/intl").EliceIntlShape;
31
- } & React.RefAttributes<MaterialQuizEditRef>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<MaterialQuizEditRef>>;
25
+ } & React.RefAttributes<HTMLFormElement>, keyof import("@elice/intl").IntlComponentExtraProps | "__intl">, "ref"> & React.RefAttributes<HTMLFormElement>>;
32
26
  export default _default;
@@ -1,4 +1,3 @@
1
- import { defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { jsx } from 'react/jsx-runtime';
3
2
  import React, { forwardRef } from 'react';
4
3
  import { useForm, FormProvider } from 'react-hook-form';
@@ -71,10 +70,6 @@ var MaterialQuizEdit = forwardRef(function (_ref, ref) {
71
70
  reset: function reset() {
72
71
  useFormMethods.reset(manipulateValue(value));
73
72
  void useFormMethods.trigger();
74
- },
75
- setValue: function setValue(name, fieldValue, options) {
76
- var formValue = name === 'optionsDefault' || name === 'groups' ? manipulateValue(Object.assign(Object.assign({}, value), _defineProperty({}, name, fieldValue)))[name] : fieldValue;
77
- useFormMethods.setValue(name, formValue, options);
78
73
  }
79
74
  });
80
75
  }, [useFormMethods, value]);
@@ -1,2 +1,2 @@
1
1
  export { default as MaterialQuizEdit } from './MaterialQuizEdit';
2
- export type { MaterialQuizEditProps, MaterialQuizEditFormState, MaterialQuizEditRef, MaterialQuizEditValue, } from './MaterialQuizEdit';
2
+ export type { MaterialQuizEditProps, MaterialQuizEditFormState, MaterialQuizEditValue, } from './MaterialQuizEdit';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elice/material-quiz",
3
- "version": "1.261020.0-materialquizeditsetvalue.0",
3
+ "version": "1.261022.0",
4
4
  "description": "User view and editing components of Elice material quiz",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,8 +39,8 @@
39
39
  "@tanstack/react-query": "^4",
40
40
  "react": "^18.0.0 || ^19.0.0",
41
41
  "react-use": "^17.0.0",
42
- "@elice/material-shared-types": "1.261020.0-materialquizeditsetvalue.0",
43
- "@elice/material-shared-utils": "1.261020.0-materialquizeditsetvalue.0"
42
+ "@elice/material-shared-types": "1.261022.0",
43
+ "@elice/material-shared-utils": "1.261022.0"
44
44
  },
45
45
  "dependencies": {
46
46
  "@dnd-kit/core": "^6.1.0",
@@ -60,7 +60,7 @@
60
60
  "tslib": "^2.6.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@elice/api-client": "1.260529.0",
63
+ "@elice/api-client": "1.261022.0",
64
64
  "@elice/blocks": "1.260723.0",
65
65
  "@elice/design-tokens": "^1.220803.0",
66
66
  "@elice/eds-kit": "1.261005.0",
@@ -73,7 +73,7 @@
73
73
  "@elice/openapi-client-course": "^1.250702.0",
74
74
  "@elice/openapi-client-file": "^1.240619.0",
75
75
  "@elice/rollup-config": "^1.260406.0",
76
- "@elice/types": "1.260608.0",
76
+ "@elice/types": "1.261022.0",
77
77
  "@elice/wysiwyg": "1.260915.0-edsmigration.1",
78
78
  "@emotion/react": "^11.10.0",
79
79
  "@emotion/styled": "^11.10.0",
@@ -96,8 +96,8 @@
96
96
  "react-use": "^17.2.4",
97
97
  "rollup": "^4.0.0",
98
98
  "typescript": "~5.9.3",
99
- "@elice/material-shared-types": "1.261020.0-materialquizeditsetvalue.0",
100
- "@elice/material-shared-utils": "1.261020.0-materialquizeditsetvalue.0"
99
+ "@elice/material-shared-types": "1.261022.0",
100
+ "@elice/material-shared-utils": "1.261022.0"
101
101
  },
102
102
  "scripts": {
103
103
  "start": "run-s watch",