@es-joy/jsoe 0.13.5 → 0.13.6

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.
package/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGES TO `@es-joy/jsoe`
2
2
 
3
+ ## 0.13.6
4
+
5
+ - fix: distribution file not updated
6
+
3
7
  ## 0.13.5
4
8
 
5
9
  - fix(TS): allow for default arguments
package/dist/index.js CHANGED
@@ -3179,13 +3179,15 @@ const encapsulateObserver = (stateObj) => {
3179
3179
  newValue = typesonPathToJSONPointer(cyclicKeypath);
3180
3180
  newType = type === 'array' ? 'arrayReference' : 'objectReference';
3181
3181
  newType = canonicalToAvailableType(
3182
- types, formats, format, state, newType, value
3182
+ /** @type {import('../types.js').default} */ (types),
3183
+ /** @type {import('../formats.js').default} */ (formats),
3184
+ format, state, newType, value
3183
3185
  ); // Todo (low): Add accurate state for second argument
3184
3186
  } else {
3185
3187
  try {
3186
3188
  newType = canonicalToAvailableType(
3187
- types,
3188
- formats,
3189
+ /** @type {import('../types.js').default} */ (types),
3190
+ /** @type {import('../formats.js').default} */ (formats),
3189
3191
  format,
3190
3192
  state,
3191
3193
  /**
@@ -3222,7 +3224,7 @@ const encapsulateObserver = (stateObj) => {
3222
3224
 
3223
3225
  if (!stateObj.rootUI) {
3224
3226
  // console.log('vvvv0', newType, newValue);
3225
- stateObj.rootUI = types.getUIForModeAndType({
3227
+ stateObj.rootUI = types?.getUIForModeAndType({
3226
3228
  readonly,
3227
3229
  typeNamespace,
3228
3230
  type: newType,
@@ -3320,13 +3322,13 @@ const encapsulateObserver = (stateObj) => {
3320
3322
  }
3321
3323
 
3322
3324
  if (!readonly) {
3323
- types.setValue({
3325
+ types?.setValue({
3324
3326
  type: newType,
3325
3327
  // eslint-disable-next-line object-shorthand -- TS
3326
3328
  root: /** @type {HTMLDivElement} */ (root),
3327
3329
  value: newValue
3328
3330
  });
3329
- types.validate({
3331
+ types?.validate({
3330
3332
  type: newType,
3331
3333
  // eslint-disable-next-line object-shorthand -- TS
3332
3334
  root: /** @type {HTMLDivElement} */ (root),
@@ -11016,7 +11018,7 @@ const getPropertyValueFromLegend = (legend) => {
11016
11018
  * state and path.
11017
11019
  * @callback GetValueForRoot
11018
11020
  * @param {RootElement} root
11019
- * @param {StateObject} stateObj
11021
+ * @param {StateObject} [stateObj]
11020
11022
  * @param {string} [currentPath]
11021
11023
  * @returns {StructuredCloneValue}
11022
11024
  */
@@ -11033,7 +11035,7 @@ const getPropertyValueFromLegend = (legend) => {
11033
11035
  * Utility to get the value for a root using its ancestor and state.
11034
11036
  * @callback GetValueFromRootAncestor
11035
11037
  * @param {string|HTMLElement} selOrEl
11036
- * @param {StateObject} stateObj
11038
+ * @param {StateObject} [stateObj]
11037
11039
  * @returns {StructuredCloneValue}
11038
11040
  */
11039
11041
 
@@ -11071,8 +11073,8 @@ const getPropertyValueFromLegend = (legend) => {
11071
11073
  * typeNamespace?: string,
11072
11074
  * "readonly"?: boolean,
11073
11075
  * format?: import('./formats.js').AvailableFormat,
11074
- * formats: import('./formats.js').default,
11075
- * types: Types,
11076
+ * formats?: import('./formats.js').default,
11077
+ * types?: Types,
11076
11078
  * error?: Error,
11077
11079
  * rootUI?: Element,
11078
11080
  * schema?: string,
@@ -11525,7 +11527,13 @@ class Types {
11525
11527
  ]
11526
11528
  );
11527
11529
  return typeObject.getValue({
11528
- root, stateObj, currentPath
11530
+ root,
11531
+ stateObj: {
11532
+ types: this,
11533
+ formats: this.formats,
11534
+ ...stateObj
11535
+ },
11536
+ currentPath
11529
11537
  });
11530
11538
  }
11531
11539
 
@@ -11549,6 +11557,7 @@ class Types {
11549
11557
  ($e(selOrEl, 'div[data-type]')),
11550
11558
  {
11551
11559
  ...stateObj,
11560
+ types: this,
11552
11561
  formats: this.formats
11553
11562
  }
11554
11563
  );
@@ -11983,7 +11992,7 @@ const getFormatAndSchemaChoices = ({schema, hasKeyPath} = {}) => {
11983
11992
  * plain object).
11984
11993
  * @param {string} [cfg.typeNamespace] Used to prevent conflicts with other
11985
11994
  * instances of typeChoices on the page
11986
- * @param {import('./formats.js').default} cfg.formats
11995
+ * @param {import('./formats.js').default} [cfg.formats]
11987
11996
  * @param {import('./types.js').default} [cfg.types]
11988
11997
  * @returns {{
11989
11998
  * formatChoices: FormatChoices,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@es-joy/jsoe",
3
- "version": "0.13.5",
3
+ "version": "0.13.6",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./src/index.js",
@@ -14,7 +14,7 @@
14
14
  "scripts": {
15
15
  "tsc": "tsc",
16
16
  "tsc-cypress": "tsc -p cypress/tsconfig.json",
17
- "prepublishOnly": "tsc",
17
+ "prepublishOnly": "run-p tsc rollup",
18
18
  "eslint": "eslint .",
19
19
  "lint": "npm run eslint --",
20
20
  "coverage": "open-cli http://localhost:8087/coverage/lcov-report/",