@dialob/composer-material 0.0.11 → 0.0.13

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/README.md CHANGED
@@ -102,3 +102,11 @@ pnpm run preview
102
102
  Starts preview server for built application from `/dist` (No hot-reload!). Run `pnpm build` first to build the package
103
103
 
104
104
  ---
105
+
106
+ ### Customixing Markdown components
107
+
108
+ You can customize how markdown is rendered by passing custom components to the `Markdown` component from `react-markdown`.
109
+
110
+ List of available components can be found in [`src/defaults/markdown.tsx`](https://github.com/dialob/dialob-parent/blob/dev/frontend/dialob-composer-material/src/defaults/markdown.tsx). See also [`src/components/editors/LocalizedStringEditor.tsx`](https://github.com/dialob/dialob-parent/blob/dev/frontend/dialob-composer-material/src/components/editors/LocalizedStringEditor.tsx) for an example of how to use custom components. To support table rendering, you also need to include the `remark-gfm` plugin.
111
+
112
+ The same components can be used on the filling side as well, so that the markdown looks the same when editing and when filling the form.
@@ -141,22 +141,7 @@ declare type ComposerState = {
141
141
  };
142
142
  variables?: (Variable | ContextVariable)[];
143
143
  valueSets?: ValueSet[];
144
- metadata: {
145
- label?: string;
146
- labels?: string[];
147
- showDisabled?: boolean;
148
- questionClientVisibility?: VisibilityType;
149
- answersRequiredByDefault?: boolean;
150
- creator?: string;
151
- tenantId?: string;
152
- savedBy?: string;
153
- languages?: string[];
154
- valid?: boolean;
155
- created?: string;
156
- lastSaved?: string;
157
- composer?: ComposerMetadata;
158
- [prop: string]: any;
159
- };
144
+ metadata: FormMetadata;
160
145
  };
161
146
 
162
147
  declare type ComposerStatus = 'ERROR' | 'WARNING' | 'INFO' | 'FATAL' | 'OK';
@@ -316,6 +301,7 @@ declare namespace DialobTypes {
316
301
  ComposerTag,
317
302
  ComposerMetadata,
318
303
  ComposerState,
304
+ FormMetadata,
319
305
  INIT_STATE,
320
306
  ComposerCallbacks
321
307
  }
@@ -369,6 +355,23 @@ declare interface FlattenedItem extends TreeItem {
369
355
  index: number;
370
356
  }
371
357
 
358
+ declare type FormMetadata = {
359
+ label?: string;
360
+ labels?: string[];
361
+ showDisabled?: boolean;
362
+ questionClientVisibility?: VisibilityType;
363
+ answersRequiredByDefault?: boolean;
364
+ creator?: string;
365
+ tenantId?: string;
366
+ savedBy?: string;
367
+ languages?: string[];
368
+ valid?: boolean;
369
+ created?: string;
370
+ lastSaved?: string;
371
+ composer?: ComposerMetadata;
372
+ [prop: string]: any;
373
+ };
374
+
372
375
  export declare const FormOptionsDialog: default_2.FC<{
373
376
  open: boolean;
374
377
  onClose: () => void;
@@ -551,6 +554,7 @@ declare interface SavingState {
551
554
  valueSets?: ValueSet[];
552
555
  composerMetadata?: ComposerMetadata;
553
556
  variables?: (ContextVariable | Variable)[];
557
+ formMetadata?: FormMetadata;
554
558
  }
555
559
 
556
560
  export declare const SimpleField: default_2.FC<{
@@ -632,6 +636,7 @@ export declare const useComposer: () => {
632
636
  applyItemChanges: (newState: SavingState) => void;
633
637
  applyListChanges: (newState: SavingState) => void;
634
638
  applyVariableChanges: (newState: SavingState) => void;
639
+ applyFormChanges: (newState: SavingState) => void;
635
640
  form: ComposerState;
636
641
  };
637
642
 
@@ -648,6 +653,8 @@ export declare const useEditor: () => {
648
653
  setActiveList: (listId?: string) => void;
649
654
  setActiveVariableTab: (tab?: VariableTabType) => void;
650
655
  setConfirmationActiveItem: (item?: DialobItem) => void;
656
+ toggleItemCollapsed: (itemId: string) => void;
657
+ setMarkdownHelpDialogOpen: (open: boolean) => void;
651
658
  };
652
659
 
653
660
  declare const useErrorColor: (error: EditorError | undefined) => string | undefined;