@useinsider/ab-components 0.0.113 → 0.0.115-beta.5

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/dist/index.d.ts CHANGED
@@ -10,8 +10,10 @@ import { CSSProperties } from 'vue';
10
10
  import { DebuggerEvent } from 'vue';
11
11
  import { DefineComponent } from 'vue';
12
12
  import { DirectiveBinding } from 'vue';
13
+ import { editor } from 'monaco-editor';
13
14
  import { GlobalComponents } from 'vue';
14
15
  import { GlobalDirectives } from 'vue';
16
+ import { monacoEditor } from 'monaco-editor';
15
17
  import { nextTick } from 'vue';
16
18
  import { OnCleanup } from '@vue/reactivity';
17
19
  import { Placement } from '@floating-ui/vue';
@@ -1057,6 +1059,11 @@ declare interface InToggleProps {
1057
1059
  disabled?: boolean;
1058
1060
  }
1059
1061
 
1062
+ export declare interface LiquidVariable {
1063
+ key: string;
1064
+ displayName?: string;
1065
+ }
1066
+
1060
1067
  export declare interface MenuItem {
1061
1068
  text: string;
1062
1069
  value: string;
@@ -1078,6 +1085,59 @@ declare interface ModalProps {
1078
1085
  hasOverlay?: boolean;
1079
1086
  }
1080
1087
 
1088
+ export declare const MonacoEditor: DefineComponent<MonacoEditorProps, {
1089
+ getCode: () => Promise<{
1090
+ code: string;
1091
+ valid: boolean;
1092
+ }>;
1093
+ }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
1094
+ "update:codeEditorLength": (length: number) => any;
1095
+ "update:shouldShowLengthError": (show: boolean) => any;
1096
+ "update:valid": (valid: boolean) => any;
1097
+ ready: (editor: editor.IStandaloneCodeEditor) => any;
1098
+ destroyed: () => any;
1099
+ }, string, PublicProps, Readonly<MonacoEditorProps> & Readonly<{
1100
+ "onUpdate:codeEditorLength"?: ((length: number) => any) | undefined;
1101
+ "onUpdate:shouldShowLengthError"?: ((show: boolean) => any) | undefined;
1102
+ "onUpdate:valid"?: ((valid: boolean) => any) | undefined;
1103
+ onReady?: ((editor: editor.IStandaloneCodeEditor) => any) | undefined;
1104
+ onDestroyed?: (() => any) | undefined;
1105
+ }>, {
1106
+ code: string;
1107
+ placeholder: string;
1108
+ language: keyof ReturnType<typeof useValidators>;
1109
+ disableValidation: boolean;
1110
+ liquidVariables: LiquidVariable[];
1111
+ editorOptions: editor.IStandaloneEditorConstructionOptions;
1112
+ errorGlyph: boolean;
1113
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
1114
+ iframe: HTMLIFrameElement;
1115
+ }, HTMLIFrameElement>;
1116
+
1117
+ export declare interface MonacoEditorProps {
1118
+ language?: keyof ReturnType<typeof useValidators>;
1119
+ code?: string;
1120
+ disableValidation?: boolean;
1121
+ /**
1122
+ * Absolute URL to the served Monaco `vs` directory. The consuming app must
1123
+ * host these assets. When omitted, falls back to the current origin + `/vs`.
1124
+ */
1125
+ monacoVsPath?: string;
1126
+ /**
1127
+ * Dynamic variables suggested by autocomplete when `language` is `liquid`.
1128
+ */
1129
+ liquidVariables?: LiquidVariable[];
1130
+ /**
1131
+ * Per-consumer Monaco options merged over the shared defaults (e.g. disabling
1132
+ * the minimap). `language`/`value` are always owned by the component.
1133
+ */
1134
+ editorOptions?: editor.IStandaloneEditorConstructionOptions;
1135
+ /** Render the custom error icon (gutter) + hover infobox. Off by default. */
1136
+ errorGlyph?: boolean;
1137
+ /** Dimmed text shown over the editor while it is empty. */
1138
+ placeholder?: string;
1139
+ }
1140
+
1081
1141
  export declare const NumberInput: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
1082
1142
  input: (event: Event) => any;
1083
1143
  blur: (event: FocusEvent) => any;
@@ -1358,4 +1418,26 @@ declare interface TypographyProps {
1358
1418
 
1359
1419
  declare type TypographyVariant = 'heading' | 'title' | 'body' | 'body-default' | 'body-muted' | 'label' | 'detail' | 'detail-muted' | 'detail-danger' | 'section';
1360
1420
 
1421
+ declare function useValidators(): {
1422
+ javascript(editor: editor, monaco: monacoEditor): Promise<{
1423
+ valid: boolean;
1424
+ results: editor[];
1425
+ }>;
1426
+ html(editor: editor, monaco: monacoEditor): Promise<{
1427
+ valid: boolean;
1428
+ results: never[];
1429
+ } | {
1430
+ valid: false;
1431
+ results: editor[];
1432
+ }>;
1433
+ css(editor: editor, monaco: monacoEditor): Promise<{
1434
+ valid: boolean;
1435
+ results: editor[];
1436
+ }>;
1437
+ liquid(editor: editor, monaco: monacoEditor, knownKeys?: string[] | undefined): Promise<{
1438
+ valid: boolean;
1439
+ results: editor[];
1440
+ }>;
1441
+ };
1442
+
1361
1443
  export { }