@bpmn-io/form-js-playground 1.8.8 → 1.9.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.
@@ -82382,81 +82382,63 @@
82382
82382
  function hasIntegerPathSegment(path) {
82383
82383
  return path.split('.').some(segment => /^\d+$/.test(segment));
82384
82384
  }
82385
- function useService(type, strict) {
82385
+ const headerlessTypes = ['spacer', 'separator', 'expression', 'html'];
82386
+ function getPropertiesPanelHeaderProvider(options = {}) {
82386
82387
  const {
82387
- getService
82388
- } = F$1(FormPropertiesPanelContext);
82389
- return getService(type, strict);
82390
- }
82391
-
82392
- /**
82393
- * Retrieve list of variables from the form schema.
82394
- *
82395
- * @returns { string[] } list of variables used in form schema
82396
- */
82397
- function useVariables() {
82398
- const form = useService('formEditor');
82399
- const schema = form.getSchema();
82400
- return getSchemaVariables(schema);
82388
+ getDocumentationRef,
82389
+ formFields
82390
+ } = options;
82391
+ return {
82392
+ getElementLabel: field => {
82393
+ const {
82394
+ type
82395
+ } = field;
82396
+ if (headerlessTypes.includes(type)) {
82397
+ return '';
82398
+ }
82399
+ if (type === 'text') {
82400
+ return textToLabel(field.text);
82401
+ }
82402
+ if (type === 'image') {
82403
+ return field.alt;
82404
+ }
82405
+ if (type === 'default') {
82406
+ return field.id;
82407
+ }
82408
+ return field.label;
82409
+ },
82410
+ getElementIcon: field => {
82411
+ const {
82412
+ type
82413
+ } = field;
82414
+ const fieldDefinition = formFields.get(type).config;
82415
+ const Icon = fieldDefinition.icon || iconsByType(type);
82416
+ if (Icon) {
82417
+ return () => e(Icon, {
82418
+ width: "36",
82419
+ height: "36",
82420
+ viewBox: "0 0 54 54"
82421
+ });
82422
+ } else if (fieldDefinition.iconUrl) {
82423
+ return getPaletteIcon({
82424
+ iconUrl: fieldDefinition.iconUrl,
82425
+ label: fieldDefinition.label
82426
+ });
82427
+ }
82428
+ },
82429
+ getTypeLabel: field => {
82430
+ const {
82431
+ type
82432
+ } = field;
82433
+ if (type === 'default') {
82434
+ return 'Form';
82435
+ }
82436
+ const fieldDefinition = formFields.get(type).config;
82437
+ return fieldDefinition.label || type;
82438
+ },
82439
+ getDocumentationRef
82440
+ };
82401
82441
  }
82402
- const headerlessTypes = ['spacer', 'separator', 'expression', 'html'];
82403
- const PropertiesPanelHeaderProvider = {
82404
- getElementLabel: field => {
82405
- const {
82406
- type
82407
- } = field;
82408
- if (headerlessTypes.includes(type)) {
82409
- return '';
82410
- }
82411
- if (type === 'text') {
82412
- return textToLabel(field.text);
82413
- }
82414
- if (type === 'image') {
82415
- return field.alt;
82416
- }
82417
- if (type === 'default') {
82418
- return field.id;
82419
- }
82420
- return field.label;
82421
- },
82422
- getElementIcon: field => {
82423
- const {
82424
- type
82425
- } = field;
82426
-
82427
- // @Note: We know that we are inside the properties panel context,
82428
- // so we can savely use the hook here.
82429
- // eslint-disable-next-line react-hooks/rules-of-hooks
82430
- const fieldDefinition = useService('formFields').get(type).config;
82431
- const Icon = fieldDefinition.icon || iconsByType(type);
82432
- if (Icon) {
82433
- return () => e(Icon, {
82434
- width: "36",
82435
- height: "36",
82436
- viewBox: "0 0 54 54"
82437
- });
82438
- } else if (fieldDefinition.iconUrl) {
82439
- return getPaletteIcon({
82440
- iconUrl: fieldDefinition.iconUrl,
82441
- label: fieldDefinition.label
82442
- });
82443
- }
82444
- },
82445
- getTypeLabel: field => {
82446
- const {
82447
- type
82448
- } = field;
82449
- if (type === 'default') {
82450
- return 'Form';
82451
- }
82452
-
82453
- // @Note: We know that we are inside the properties panel context,
82454
- // so we can savely use the hook here.
82455
- // eslint-disable-next-line react-hooks/rules-of-hooks
82456
- const fieldDefinition = useService('formFields').get(type).config;
82457
- return fieldDefinition.label || type;
82458
- }
82459
- };
82460
82442
 
82461
82443
  /**
82462
82444
  * Provide placeholders for empty and multiple state.
@@ -82473,6 +82455,7 @@
82473
82455
  };
82474
82456
  }
82475
82457
  };
82458
+ const EMPTY = {};
82476
82459
  function PropertiesPanel(props) {
82477
82460
  const {
82478
82461
  eventBus,
@@ -82482,7 +82465,7 @@
82482
82465
  const formEditor = injector.get('formEditor');
82483
82466
  const modeling = injector.get('modeling');
82484
82467
  const selectionModule = injector.get('selection');
82485
- const propertiesPanelConfig = injector.get('config.propertiesPanel') || {};
82468
+ const propertiesPanelConfig = injector.get('config.propertiesPanel') || EMPTY;
82486
82469
  const {
82487
82470
  feelPopupContainer
82488
82471
  } = propertiesPanelConfig;
@@ -82536,6 +82519,11 @@
82536
82519
  return updater(groups);
82537
82520
  }, []);
82538
82521
  }, [providers, selectedFormField, editField]);
82522
+ const formFields = getService('formFields');
82523
+ const PropertiesPanelHeaderProvider = d(() => getPropertiesPanelHeaderProvider({
82524
+ getDocumentationRef: propertiesPanelConfig.getDocumentationRef,
82525
+ formFields
82526
+ }), [formFields, propertiesPanelConfig]);
82539
82527
  return e("div", {
82540
82528
  class: "fjs-properties-panel",
82541
82529
  "data-field": selectedFormField && selectedFormField.id,
@@ -82706,6 +82694,23 @@
82706
82694
  setValue
82707
82695
  });
82708
82696
  }
82697
+ function useService(type, strict) {
82698
+ const {
82699
+ getService
82700
+ } = F$1(FormPropertiesPanelContext);
82701
+ return getService(type, strict);
82702
+ }
82703
+
82704
+ /**
82705
+ * Retrieve list of variables from the form schema.
82706
+ *
82707
+ * @returns { string[] } list of variables used in form schema
82708
+ */
82709
+ function useVariables() {
82710
+ const form = useService('formEditor');
82711
+ const schema = form.getSchema();
82712
+ return getSchemaVariables(schema);
82713
+ }
82709
82714
  function AltTextEntry(props) {
82710
82715
  const {
82711
82716
  editField,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bpmn-io/form-js-playground",
3
- "version": "1.8.8",
3
+ "version": "1.9.0",
4
4
  "description": "A form-js playground",
5
5
  "files": [
6
6
  "dist"
@@ -45,7 +45,7 @@
45
45
  "url": "https://github.com/bpmn-io"
46
46
  },
47
47
  "dependencies": {
48
- "@bpmn-io/form-js-editor": "^1.8.8",
48
+ "@bpmn-io/form-js-editor": "^1.9.0",
49
49
  "@bpmn-io/form-js-viewer": "^1.8.8",
50
50
  "@codemirror/autocomplete": "^6.16.0",
51
51
  "@codemirror/commands": "^6.5.0",
@@ -71,5 +71,5 @@
71
71
  "rollup-plugin-css-only": "^4.5.2",
72
72
  "style-loader": "^4.0.0"
73
73
  },
74
- "gitHead": "7549b6d3423ae88e877510bb0c8ac27ab8d07758"
74
+ "gitHead": "12f4d5ecd109d90e9203006097918daed1199d91"
75
75
  }