@superblocksteam/library-shared 2.0.3-next.46

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.
Files changed (134) hide show
  1. package/LICENSE.txt +87 -0
  2. package/dist/apis.d.ts +2 -0
  3. package/dist/apis.d.ts.map +1 -0
  4. package/dist/apis.js +4 -0
  5. package/dist/apis.js.map +1 -0
  6. package/dist/bindings.d.ts +8 -0
  7. package/dist/bindings.d.ts.map +1 -0
  8. package/dist/bindings.js +16 -0
  9. package/dist/bindings.js.map +1 -0
  10. package/dist/computed.d.ts +7 -0
  11. package/dist/computed.d.ts.map +1 -0
  12. package/dist/computed.js +11 -0
  13. package/dist/computed.js.map +1 -0
  14. package/dist/helper.d.ts +2 -0
  15. package/dist/helper.d.ts.map +1 -0
  16. package/dist/helper.js +2 -0
  17. package/dist/helper.js.map +1 -0
  18. package/dist/index.d.ts +14 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +14 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/layout.d.ts +19 -0
  23. package/dist/layout.d.ts.map +1 -0
  24. package/dist/layout.js +53 -0
  25. package/dist/layout.js.map +1 -0
  26. package/dist/mobx-sync/apply-patch.d.ts +6 -0
  27. package/dist/mobx-sync/apply-patch.d.ts.map +1 -0
  28. package/dist/mobx-sync/apply-patch.js +93 -0
  29. package/dist/mobx-sync/apply-patch.js.map +1 -0
  30. package/dist/mobx-sync/index.d.ts +4 -0
  31. package/dist/mobx-sync/index.d.ts.map +1 -0
  32. package/dist/mobx-sync/index.js +4 -0
  33. package/dist/mobx-sync/index.js.map +1 -0
  34. package/dist/mobx-sync/to-patch.d.ts +6 -0
  35. package/dist/mobx-sync/to-patch.d.ts.map +1 -0
  36. package/dist/mobx-sync/to-patch.js +48 -0
  37. package/dist/mobx-sync/to-patch.js.map +1 -0
  38. package/dist/mobx-sync/utils.d.ts +5 -0
  39. package/dist/mobx-sync/utils.d.ts.map +1 -0
  40. package/dist/mobx-sync/utils.js +20 -0
  41. package/dist/mobx-sync/utils.js.map +1 -0
  42. package/dist/pages.d.ts +52 -0
  43. package/dist/pages.d.ts.map +1 -0
  44. package/dist/pages.js +13 -0
  45. package/dist/pages.js.map +1 -0
  46. package/dist/props/helpers.d.ts +21 -0
  47. package/dist/props/helpers.d.ts.map +1 -0
  48. package/dist/props/helpers.js +155 -0
  49. package/dist/props/helpers.js.map +1 -0
  50. package/dist/props/prop-types.d.ts +52 -0
  51. package/dist/props/prop-types.d.ts.map +1 -0
  52. package/dist/props/prop-types.js +14 -0
  53. package/dist/props/prop-types.js.map +1 -0
  54. package/dist/props/properties-panel.d.ts +163 -0
  55. package/dist/props/properties-panel.d.ts.map +1 -0
  56. package/dist/props/properties-panel.js +15 -0
  57. package/dist/props/properties-panel.js.map +1 -0
  58. package/dist/props.d.ts +4 -0
  59. package/dist/props.d.ts.map +1 -0
  60. package/dist/props.js +4 -0
  61. package/dist/props.js.map +1 -0
  62. package/dist/scope.d.ts +2 -0
  63. package/dist/scope.d.ts.map +1 -0
  64. package/dist/scope.js +5 -0
  65. package/dist/scope.js.map +1 -0
  66. package/dist/types/apis.d.ts +28 -0
  67. package/dist/types/apis.d.ts.map +1 -0
  68. package/dist/types/apis.js +2 -0
  69. package/dist/types/apis.js.map +1 -0
  70. package/dist/types/common.d.ts +16 -0
  71. package/dist/types/common.d.ts.map +1 -0
  72. package/dist/types/common.js +2 -0
  73. package/dist/types/common.js.map +1 -0
  74. package/dist/types/edit-operations.d.ts +204 -0
  75. package/dist/types/edit-operations.d.ts.map +1 -0
  76. package/dist/types/edit-operations.js +9 -0
  77. package/dist/types/edit-operations.js.map +1 -0
  78. package/dist/types/entities.d.ts +59 -0
  79. package/dist/types/entities.d.ts.map +1 -0
  80. package/dist/types/entities.js +10 -0
  81. package/dist/types/entities.js.map +1 -0
  82. package/dist/types/errors.d.ts +14 -0
  83. package/dist/types/errors.d.ts.map +1 -0
  84. package/dist/types/errors.js +2 -0
  85. package/dist/types/errors.js.map +1 -0
  86. package/dist/types/events.d.ts +45 -0
  87. package/dist/types/events.d.ts.map +1 -0
  88. package/dist/types/events.js +21 -0
  89. package/dist/types/events.js.map +1 -0
  90. package/dist/types/index.d.ts +13 -0
  91. package/dist/types/index.d.ts.map +1 -0
  92. package/dist/types/index.js +13 -0
  93. package/dist/types/index.js.map +1 -0
  94. package/dist/types/mobx-patch.d.ts +22 -0
  95. package/dist/types/mobx-patch.d.ts.map +1 -0
  96. package/dist/types/mobx-patch.js +5 -0
  97. package/dist/types/mobx-patch.js.map +1 -0
  98. package/dist/types/mobx-shared-state.d.ts +9 -0
  99. package/dist/types/mobx-shared-state.d.ts.map +1 -0
  100. package/dist/types/mobx-shared-state.js +2 -0
  101. package/dist/types/mobx-shared-state.js.map +1 -0
  102. package/dist/types/parent-messages.d.ts +52 -0
  103. package/dist/types/parent-messages.d.ts.map +1 -0
  104. package/dist/types/parent-messages.js +2 -0
  105. package/dist/types/parent-messages.js.map +1 -0
  106. package/dist/types/scope.d.ts +22 -0
  107. package/dist/types/scope.d.ts.map +1 -0
  108. package/dist/types/scope.js +2 -0
  109. package/dist/types/scope.js.map +1 -0
  110. package/dist/types/socket.d.ts +108 -0
  111. package/dist/types/socket.d.ts.map +1 -0
  112. package/dist/types/socket.js +2 -0
  113. package/dist/types/socket.js.map +1 -0
  114. package/dist/types/theme.d.ts +302 -0
  115. package/dist/types/theme.d.ts.map +1 -0
  116. package/dist/types/theme.js +8 -0
  117. package/dist/types/theme.js.map +1 -0
  118. package/dist/utils/dotted-paths.d.ts +10 -0
  119. package/dist/utils/dotted-paths.d.ts.map +1 -0
  120. package/dist/utils/dotted-paths.js +85 -0
  121. package/dist/utils/dotted-paths.js.map +1 -0
  122. package/dist/utils/name-generator.d.ts +3 -0
  123. package/dist/utils/name-generator.d.ts.map +1 -0
  124. package/dist/utils/name-generator.js +22 -0
  125. package/dist/utils/name-generator.js.map +1 -0
  126. package/dist/utils/properties.d.ts +20 -0
  127. package/dist/utils/properties.d.ts.map +1 -0
  128. package/dist/utils/properties.js +60 -0
  129. package/dist/utils/properties.js.map +1 -0
  130. package/dist/utils/strings.d.ts +2 -0
  131. package/dist/utils/strings.d.ts.map +1 -0
  132. package/dist/utils/strings.js +7 -0
  133. package/dist/utils/strings.js.map +1 -0
  134. package/package.json +54 -0
@@ -0,0 +1,21 @@
1
+ import type { PropertiesPanelDefinition, WidgetPropertyDefinition } from "./properties-panel.js";
2
+ import type { PropertyInfo } from "../types/index.js";
3
+ export declare const getPropertiesDefinitionByPath: (propertiesPanelDefinition: PropertiesPanelDefinition | null) => Record<string, WidgetPropertyDefinition<unknown>>;
4
+ /**
5
+ * Get the property definition by path.
6
+ * @param path - The path to the property.
7
+ * @param propertiesPanelDefinition - The properties panel definition.
8
+ * @returns The property definition.
9
+ */
10
+ export declare const getPropertyDefinitionByPath: (path: string, propertiesPanelDefinition: PropertiesPanelDefinition | null) => WidgetPropertyDefinition<unknown> | undefined;
11
+ /**
12
+ * Get the property value in the correct format based on the property definition. This will allow
13
+ * to be parsed correctly depending on the type. For example, if the property is a dimension, it will
14
+ * be parsed as Dim.px(1) instead of { mode: "px", value: 1 }.
15
+ * @param value - The value of the property.
16
+ * @param propertyDefinition - The property definition.
17
+ * @returns The property in PropertyInfo format.
18
+ */
19
+ export declare function getPropertyInfo(value: any, propertyDefinition?: WidgetPropertyDefinition<unknown>): PropertyInfo;
20
+ export declare function updatePropertyInfoValue(obj: Record<string, PropertyInfo>, path: string, newValue: any): Record<string, PropertyInfo>;
21
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/props/helpers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,6BAA6B,GACxC,2BAA2B,yBAAyB,GAAG,IAAI,KAC1D,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,OAAO,CAAC,CA+BlD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACtC,MAAM,MAAM,EACZ,2BAA2B,yBAAyB,GAAG,IAAI,KAC1D,wBAAwB,CAAC,OAAO,CAAC,GAAG,SAmBtC,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,GAAG,EACV,kBAAkB,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,GACrD,YAAY,CA6Dd;AAmDD,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,GAAG,GACZ,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAY9B"}
@@ -0,0 +1,155 @@
1
+ import { containsBindingsAnywhere } from "@superblocksteam/shared";
2
+ import { isComputedExpression } from "../computed.js";
3
+ import { isPropertyInfo, Property } from "../utils/properties.js";
4
+ import { containsStringInterpolation } from "../utils/strings.js";
5
+ export const getPropertiesDefinitionByPath = (propertiesPanelDefinition) => {
6
+ if (!propertiesPanelDefinition) {
7
+ return {};
8
+ }
9
+ function processChildren(children) {
10
+ let ps = {};
11
+ Object.values(children).forEach((child) => {
12
+ ps = {
13
+ ...ps,
14
+ [child.path]: child,
15
+ ...(child.children ? processChildren(child.children) : {}),
16
+ };
17
+ });
18
+ return ps;
19
+ }
20
+ let properties = {};
21
+ propertiesPanelDefinition.sections.forEach((section) => {
22
+ section.children.forEach((child) => {
23
+ properties = {
24
+ ...properties,
25
+ [child.path]: child,
26
+ ...(child.children ? processChildren(child.children) : {}),
27
+ };
28
+ });
29
+ });
30
+ return properties;
31
+ };
32
+ /**
33
+ * Get the property definition by path.
34
+ * @param path - The path to the property.
35
+ * @param propertiesPanelDefinition - The properties panel definition.
36
+ * @returns The property definition.
37
+ */
38
+ export const getPropertyDefinitionByPath = (path, propertiesPanelDefinition) => {
39
+ const propertiesDefinitionByPath = getPropertiesDefinitionByPath(propertiesPanelDefinition);
40
+ const pathParts = path.split(".");
41
+ let definitionPath = "";
42
+ while (pathParts.length > 0) {
43
+ definitionPath = `${definitionPath ? `${definitionPath}.` : ""}${pathParts.shift()}`;
44
+ const definition = propertiesDefinitionByPath[definitionPath];
45
+ // If the definition is a recordOf type, we need to remove the property name from the path
46
+ // as it will not be part of the definition. For example, if we define a property column as
47
+ // recordOf. The structure of the definition will be in column.label while the path will contain
48
+ // the name of the column (column.name.label)
49
+ if (definition?.dataType === "recordOf") {
50
+ pathParts.shift();
51
+ }
52
+ }
53
+ return propertiesDefinitionByPath[definitionPath];
54
+ };
55
+ /**
56
+ * Get the property value in the correct format based on the property definition. This will allow
57
+ * to be parsed correctly depending on the type. For example, if the property is a dimension, it will
58
+ * be parsed as Dim.px(1) instead of { mode: "px", value: 1 }.
59
+ * @param value - The value of the property.
60
+ * @param propertyDefinition - The property definition.
61
+ * @returns The property in PropertyInfo format.
62
+ */
63
+ export function getPropertyInfo(value, propertyDefinition) {
64
+ if (typeof value === "string" && containsBindingsAnywhere(value)) {
65
+ return Property.Binding(value);
66
+ }
67
+ else if (typeof value === "string" && isComputedExpression(value)) {
68
+ return Property.Computed(value);
69
+ }
70
+ else if (typeof value === "string" && containsStringInterpolation(value)) {
71
+ return Property.Template(value);
72
+ }
73
+ if (!propertyDefinition) {
74
+ return Property.Static(value);
75
+ }
76
+ switch (propertyDefinition.dataType) {
77
+ case "dimension":
78
+ return Property.Dimension(value);
79
+ case "composite": {
80
+ if (typeof value === "object" && value !== null) {
81
+ return Property.Static(Object.entries(value).reduce((acc, [key, child]) => {
82
+ return {
83
+ ...acc,
84
+ [key]: getPropertyInfo(child, propertyDefinition.children?.[key]),
85
+ };
86
+ }, {}));
87
+ }
88
+ return Property.Static(value);
89
+ }
90
+ case "recordOf": {
91
+ if (typeof value === "object" && value !== null) {
92
+ // this is a record of records. Where each record has the same shape defined by the property definition
93
+ const records = Object.entries(value).reduce((acc, [name, r]) => {
94
+ acc[name] = getPropertyInfo(r, propertyDefinition.children?.[name]);
95
+ return acc;
96
+ }, {});
97
+ return Property.Static(records);
98
+ }
99
+ return Property.Static(value);
100
+ }
101
+ case "event":
102
+ return Property.Event(value);
103
+ default:
104
+ return Property.Static(value);
105
+ }
106
+ }
107
+ function updatePropertyValue(obj, path, newValue) {
108
+ const [current, ...rest] = path;
109
+ if (!current) {
110
+ return newValue;
111
+ }
112
+ if (obj && (typeof obj !== "object" || Array.isArray(obj))) {
113
+ console.error(`${obj} could not be updated because it is not an object`);
114
+ return obj;
115
+ }
116
+ let returnedObject;
117
+ if (!obj) {
118
+ returnedObject = Property.Static({});
119
+ }
120
+ else if (!isPropertyInfo(obj)) {
121
+ returnedObject = Property.Static(obj);
122
+ }
123
+ else {
124
+ returnedObject = { ...obj };
125
+ }
126
+ if (rest.length === 0) {
127
+ return {
128
+ ...returnedObject,
129
+ value: {
130
+ ...(returnedObject.value ?? {}),
131
+ [current]: newValue,
132
+ },
133
+ };
134
+ }
135
+ return {
136
+ ...returnedObject,
137
+ value: {
138
+ ...(returnedObject.value ?? {}),
139
+ [current]: updatePropertyValue(returnedObject.value?.[current] ||
140
+ undefined, rest, newValue),
141
+ },
142
+ };
143
+ }
144
+ export function updatePropertyInfoValue(obj, path, newValue) {
145
+ const pathList = path.split(".");
146
+ const [property, ...rest] = pathList;
147
+ if (!property) {
148
+ return obj;
149
+ }
150
+ return {
151
+ ...obj,
152
+ [property]: updatePropertyValue(obj[property], rest, newValue),
153
+ };
154
+ }
155
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/props/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,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QACjB,KAAK,EAAE;YACL,GAAG,CAAC,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC;YAC/B,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAC3B,cAAc,CAAC,KAAsC,EAAE,CAAC,OAAO,CAAC;gBAC/D,SAAS,EACX,IAAI,EACJ,QAAQ,CACT;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,GAAiC,EACjC,IAAY,EACZ,QAAa;IAEb,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC;IAErC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO;QACL,GAAG,GAAG;QACN,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC;KAC/D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { PropertiesPanelDisplay } from "./properties-panel.js";
2
+ import type { ISbEventFlow } from "../types/events.js";
3
+ type SbEventFlow = ISbEventFlow<any, any, any>;
4
+ export type DataType = string | number | boolean | SbEventFlow | any | undefined;
5
+ export type DataTypeString = "string" | "number" | "boolean" | "event" | "any" | "undefined" | "composite" | "dimension" | "recordOf" | "array" | "function";
6
+ export type DataTypeToNativeType<T extends DataType> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends SbEventFlow ? SbEventFlow : T extends any ? any : never;
7
+ export type PropertyForData<T extends DataType> = {
8
+ path: string;
9
+ dataType: DataTypeString;
10
+ /**
11
+ * The presence of this object determines whether or not this property
12
+ * shows up in the Superblocks properties panel.
13
+ **/
14
+ propertiesPanelDisplay?: PropertiesPanelDisplay<T>;
15
+ /**
16
+ * A description of this property. This is used in the Superblocks properties panel
17
+ * as well as in the custom component's autocomplete.
18
+ **/
19
+ description?: string;
20
+ /**
21
+ * By default, all your properties are readable from anywhere in Superblocks using dot notation
22
+ * (e.g. `myComponent.myProperty`). If you want to hide a property from the outside world,
23
+ * set this to false
24
+ * @default true
25
+ */
26
+ isExternallyReadable?: boolean;
27
+ /**
28
+ * By default, all properties can have be used with Set Component Property and Reset Component to Default.
29
+ * @default true
30
+ **/
31
+ isExternallySettable?: boolean;
32
+ };
33
+ export type Property = PropertyForData<string> | PropertyForData<number> | PropertyForData<boolean> | PropertyForData<SbEventFlow> | PropertyForData<any> | PropertyForData<undefined>;
34
+ export type ControlTypeForDataType<T extends DataType> = T extends boolean ? "INPUT_TEXT" | "INPUT_JS_EXPR" | "SWITCH" : Exclude<ControlType, "SWITCH">;
35
+ export type ControlType = "INPUT_TEXT" | "INPUT_NUMBER" | "CHILD_LIST" | "RADIO_BUTTON_GROUP" | "INPUT_JS_EXPR" | "INPUT_ARRAY_EXPR" | "INPUT_EXPR" | "DROP_DOWN" | "COLOR_PICKER" | "COLOR_PICKER_FOR_CONTAINER_BACKGROUND" | "SWITCH" | "OPTION_INPUT" | "CODE_EDITOR" | "MULTI_SELECT" | "DATE_PICKER" | "EVENT_TRIGGER" | "EVENT_ARGUMENTS_CONTROL" | "MULTI_SWITCH" | "LOCATION_SEARCH" | "STEP" | "TABS_INPUT" | "BORDER_CONTROL" | "BORDER_RADIUS_CONTROL" | "PRIMARY_COLUMNS" | "CHART_FIELD_SELECTOR" | "CHART_FIELD_MULTI_SELECTOR" | "CHART_MULTI_SERIES" | "BUTTON_TABS" | "COMPUTE_TABLE_VALUE" | "COMPUTE_TABLE_ICON_SELECTOR" | "RADIO_BUTTON" | "LABEL_VALUE_CONTROL" | "TABLE_LABEL_VALUE_CONTROL" | "RUN_APIS_CONTROL" | "PAGE_LOAD_APIS_CONTROL" | "STATIC_TEXT" | "SELECT_AND_CREATE_WIDGET_CONTROL" | "SELECT_WIDGET_CONTROL" | "SELECT_EVENT_CONTROL" | "SELECT_STATE_VAR_CONTROL" | "SELECT_TIMER_CONTROL" | "SELECT_APP_DROP_DOWN" | "DEFAULT_TABLE_SORT" | "SELECT_TABLE_COLUMN" | "KEY_VALUE_INPUT" | "KEY_VALUE_PROPERTIES" | "COMPUTE_KEY_VALUE_PROPERTY" | "ADD_KEYVALUE_PROPERTY" | "TIMER_INTERVAL" | "TIMER_STATUS" | "ADD_COLUMN" | "ADD_ROUTE" | "ADD_SECTION_COLUMN" | "ADD_SECTION" | "ADD_TAB" | "ADD_API" | "RERUN_CONTROL" | "OBJECT_INDEXER_CONTROL" | "ADD_TAG_COLOR" | "CUSTOM_TAG_COLORS" | "STACK_ALIGN" | "ICON_SELECTOR" | "CODE_EDITOR_ICON_SELECTOR" | "PADDING_CONTROL" | "MARGIN_CONTROL" | "SPACING_CONTROL" | "STICKY_POSITION" | "HEIGHT_DROPDOWN" | "WIDTH_DROPDOWN" | "SIMPLE_SIZE_CONTROL" | "DIMENSION_VALUE_CONTROL" | "ROUTE_LIST" | "ADD_ARG" | "ADD_KEY_VALUE" | "ARG_LIST" | "ROUTE_TEST_PARAMS" | "SELECT_ROUTE_DROP_DOWN" | "SELECT_ROUTE_PARAMS" | "MENU_ITEMS_INPUT" | "ADD_MENU_ITEM" | "ROUTE_PATH_EDITOR" | "ADD_OPTION" | "ADD_CHART_SERIES" | "TEXT_STYLE" | "COMPUTED_CODE_EDITOR" | "COLORED_DIMENSION_CONTROL";
36
+ export type WidgetLabelPosition = "left" | "right" | "top";
37
+ export type TextAlign = "left" | "center" | "right";
38
+ export type ErrorMessagePlacement = "inline" | "tooltip";
39
+ export declare enum InputType {
40
+ TEXT = "TEXT",
41
+ NUMBER = "NUMBER",
42
+ INTEGER = "INTEGER",
43
+ PHONE_NUMBER = "PHONE_NUMBER",
44
+ EMAIL = "EMAIL",
45
+ PASSWORD = "PASSWORD",
46
+ CURRENCY = "CURRENCY",
47
+ SEARCH = "SEARCH",
48
+ PERCENTAGE = "PERCENTAGE",
49
+ URL = "URL"
50
+ }
51
+ export {};
52
+ //# sourceMappingURL=prop-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../src/props/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,KAAK,WAAW,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE/C,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,MAAM,GACN,OAAO,GACP,WAAW,GACX,GAAG,GACH,SAAS,CAAC;AAEd,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,OAAO,GACP,KAAK,GACL,WAAW,GACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,OAAO,GACP,UAAU,CAAC;AAEf,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,QAAQ,IAAI,CAAC,SAAS,MAAM,GACnE,MAAM,GACN,CAAC,SAAS,MAAM,GACd,MAAM,GACN,CAAC,SAAS,OAAO,GACf,OAAO,GACP,CAAC,SAAS,WAAW,GACnB,WAAW,GACX,CAAC,SAAS,GAAG,GACX,GAAG,GACH,KAAK,CAAC;AAElB,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,QAAQ,IAAI;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;IACzB;;;QAGI;IACJ,sBAAsB,CAAC,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC;IACnD;;;QAGI;IACJ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;;QAGI;IACJ,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAChB,eAAe,CAAC,MA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,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,qBAAqB,GACrB,yBAAyB,GACzB,YAAY,GACZ,SAAS,GACT,eAAe,GACf,UAAU,GACV,mBAAmB,GACnB,wBAAwB,GACxB,qBAAqB,GACrB,kBAAkB,GAClB,eAAe,GACf,mBAAmB,GACnB,YAAY,GACZ,kBAAkB,GAClB,YAAY,GACZ,sBAAsB,GACtB,2BAA2B,CAAC;AAEhC,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE3D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEpD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,GAAG,QAAQ;CACZ"}
@@ -0,0 +1,14 @@
1
+ export var InputType;
2
+ (function (InputType) {
3
+ InputType["TEXT"] = "TEXT";
4
+ InputType["NUMBER"] = "NUMBER";
5
+ InputType["INTEGER"] = "INTEGER";
6
+ InputType["PHONE_NUMBER"] = "PHONE_NUMBER";
7
+ InputType["EMAIL"] = "EMAIL";
8
+ InputType["PASSWORD"] = "PASSWORD";
9
+ InputType["CURRENCY"] = "CURRENCY";
10
+ InputType["SEARCH"] = "SEARCH";
11
+ InputType["PERCENTAGE"] = "PERCENTAGE";
12
+ InputType["URL"] = "URL";
13
+ })(InputType || (InputType = {}));
14
+ //# sourceMappingURL=prop-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop-types.js","sourceRoot":"","sources":["../../src/props/prop-types.ts"],"names":[],"mappings":"AA2KA,MAAM,CAAN,IAAY,SAWX;AAXD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,0CAA6B,CAAA;IAC7B,4BAAe,CAAA;IACf,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;IACjB,sCAAyB,CAAA;IACzB,wBAAW,CAAA;AACb,CAAC,EAXW,SAAS,KAAT,SAAS,QAWpB"}
@@ -0,0 +1,163 @@
1
+ import type { ControlType, ControlTypeForDataType, DataType, InputType } from "./prop-types.js";
2
+ import type { Dim } from "../index.js";
3
+ import type { Padding } from "../types/theme.js";
4
+ type PopoverConfig = {
5
+ type: "popover";
6
+ title?: string;
7
+ panelIdPropertyName?: string;
8
+ titlePropertyName?: string;
9
+ };
10
+ type InlineConfig = {
11
+ type: "inline";
12
+ };
13
+ type ChildrenDisplayMode = InlineConfig | PopoverConfig;
14
+ type PropertyVisibility = "DEFAULT" | "SHOW_NAME" | "IF_VALUE";
15
+ export type TransformToEvaluateOrValue<T> = {
16
+ [K in keyof T]: T[K] | ((this: any, s: any) => T[K]);
17
+ };
18
+ export type PropertiesPanelDisplay<T extends DataType, CT extends ControlType = ControlTypeForDataType<T>> = TransformToEvaluateOrValue<EvaluatedPropertiesPanelDisplay<T, CT>>;
19
+ export interface EvaluatedPropertiesPanelDisplay<T extends DataType, CT extends ControlType = ControlTypeForDataType<T>> {
20
+ /**
21
+ * Determines what form item type is shown in the Superblocks properties panel.
22
+ *
23
+ * Only booleans are allowed to use the "switch" control
24
+ */
25
+ controlType: CT;
26
+ headerControlType?: ControlType;
27
+ /**
28
+ * Determines form item label in the Superblocks properties panel.
29
+ */
30
+ label: string;
31
+ /**
32
+ * Help text for the property in the Superblocks properties panel.
33
+ */
34
+ helpText?: string;
35
+ /**
36
+ * Placeholder text appears as gray text in the properties panel. This only applies
37
+ * to text-like inputs.
38
+ */
39
+ placeholder?: string;
40
+ /**
41
+ * This shows up in the popover as a user types into the properties panel.
42
+ * This is a documentation field that helps users understand what type of data is accepted
43
+ * by this property. You should give a specific example, not a generic type
44
+ *
45
+ * @example {
46
+ * label: "My Label",
47
+ * value: "myValue"
48
+ * }
49
+ */
50
+ exampleData?: string;
51
+ /**
52
+ * This shows up in the popover as a user types into the properties panel.
53
+ * This is a documentation field that helps users understand what type of data is accepted
54
+ * by this property. Typescript notation is recommended.
55
+ *
56
+ * @example "Array<{ label: string; value: string; }>"
57
+ */
58
+ expectedType?: string;
59
+ /**
60
+ * The default value should match the dataType of the property.
61
+ */
62
+ defaultValue?: T;
63
+ /**
64
+ * The default value to use when adding a property.
65
+ */
66
+ defaultOnAdd?: T;
67
+ isJSConvertible?: boolean;
68
+ isTriggerProperty?: boolean;
69
+ isRemovable?: boolean;
70
+ customJSControl?: string;
71
+ /**
72
+ * Determines how to show a property in the Superblocks properties panel.
73
+ *
74
+ * - DEFAULT: show in the panel regardless of current value
75
+ *
76
+ * - SHOW_NAME: show just the property name if the value is not defined
77
+ *
78
+ * - IF_VALUE: only show if the value is defined
79
+ */
80
+ visibility?: PropertyVisibility;
81
+ /**
82
+ * Determines if the property should be visible in the Superblocks properties panel.
83
+ */
84
+ isVisible?: boolean;
85
+ options?: CT extends "DROP_DOWN" | "RADIO_BUTTON_GROUP" | "DATE_PICKER" | "SIMPLE_SIZE_CONTROL" | "TEXT_STYLE" ? {
86
+ label?: string;
87
+ icon?: string;
88
+ isIcon?: boolean;
89
+ value?: T;
90
+ subText?: string;
91
+ labelWhenSelected?: string;
92
+ tooltip?: string;
93
+ }[] : never;
94
+ /**
95
+ * Determines how children are displayed in the Superblocks properties panel.
96
+ *
97
+ * @default "inline"
98
+ */
99
+ childrenDisplayMode?: ChildrenDisplayMode;
100
+ /**
101
+ * If true, the properties panel will force the children to be displayed in a vertical layout.
102
+ *
103
+ * @default false
104
+ */
105
+ forceVertical?: boolean;
106
+ inputType?: InputType;
107
+ /**
108
+ * If true, text style control will show a color picker for the text color.
109
+ */
110
+ enableTextColorConfig?: CT extends "TEXT_STYLE" ? boolean : never;
111
+ unitOptions?: CT extends "INPUT_NUMBER" ? {
112
+ label?: string;
113
+ value?: string;
114
+ subText?: string;
115
+ }[] : never;
116
+ defaultUnit?: CT extends "INPUT_NUMBER" ? string : never;
117
+ precision?: CT extends "INPUT_NUMBER" ? number : never;
118
+ minValue?: CT extends "INPUT_NUMBER" ? number : never;
119
+ themeValue?: CT extends "PADDING_CONTROL" ? Padding : CT extends "SPACING_CONTROL" ? Dim<"px"> : never;
120
+ /**
121
+ * If defined, this function will be called to get the intended value for the property in
122
+ * the properties panel. This is useful for properties that are derived from the actual widget props,
123
+ * like table columns.
124
+ */
125
+ propertyValue?: (widgetProps: any) => unknown;
126
+ }
127
+ export declare const PropsPanelCategory: {
128
+ readonly Content: "Content";
129
+ readonly Routing: "Routing";
130
+ readonly Interaction: "Interaction";
131
+ readonly Layout: "Layout";
132
+ readonly Appearance: "Appearance";
133
+ readonly Permissions: "Permissions";
134
+ readonly EventHandlers: "EventHandlers";
135
+ readonly Uncategorized: "Uncategorized";
136
+ readonly Meta: "Meta";
137
+ readonly Derived: "Derived";
138
+ readonly Functions: "Functions";
139
+ };
140
+ export type PropsPanelCategory = (typeof PropsPanelCategory)[keyof typeof PropsPanelCategory];
141
+ export type Relation = {
142
+ key: string;
143
+ value: unknown;
144
+ };
145
+ export type WidgetPropertyDefinition<T extends DataType> = {
146
+ path: string;
147
+ dataType: T;
148
+ relations: Relation[][];
149
+ propertiesPanelDisplay: EvaluatedPropertiesPanelDisplay<T>;
150
+ children?: Record<string, WidgetPropertyDefinition<any>>;
151
+ };
152
+ export type PropertiesPanelSectionDefinition = {
153
+ name: string;
154
+ category: PropsPanelCategory;
155
+ children: WidgetPropertyDefinition<any>[];
156
+ showHeader?: boolean;
157
+ isDefaultOpen?: boolean;
158
+ };
159
+ export type PropertiesPanelDefinition = {
160
+ sections: Array<PropertiesPanelSectionDefinition>;
161
+ };
162
+ export {};
163
+ //# sourceMappingURL=properties-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties-panel.d.ts","s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B,QAAQ,EAAE,wBAAwB,CAAC,GAAG,CAAC,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,KAAK,CAAC,gCAAgC,CAAC,CAAC;CACnD,CAAC"}
@@ -0,0 +1,15 @@
1
+ export const PropsPanelCategory = {
2
+ Content: "Content",
3
+ Routing: "Routing",
4
+ Interaction: "Interaction",
5
+ Layout: "Layout",
6
+ Appearance: "Appearance",
7
+ Permissions: "Permissions",
8
+ EventHandlers: "EventHandlers",
9
+ Uncategorized: "Uncategorized", // do not set this explicitly on a property
10
+ // these are hidden categories
11
+ Meta: "Meta",
12
+ Derived: "Derived",
13
+ Functions: "Functions",
14
+ };
15
+ //# sourceMappingURL=properties-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties-panel.js","sourceRoot":"","sources":["../../src/props/properties-panel.ts"],"names":[],"mappings":"AA+KA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,aAAa,EAAE,eAAe,EAAE,2CAA2C;IAC3E,8BAA8B;IAC9B,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACd,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./props/prop-types.js";
2
+ export * from "./props/properties-panel.js";
3
+ export * from "./props/helpers.js";
4
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC"}
package/dist/props.js ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./props/prop-types.js";
2
+ export * from "./props/properties-panel.js";
3
+ export * from "./props/helpers.js";
4
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../src/props.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getStableScopeId(scopeName: string): string;
2
+ //# sourceMappingURL=scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../src/scope.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,UAEjD"}
package/dist/scope.js ADDED
@@ -0,0 +1,5 @@
1
+ import { generatePredictableId } from "@superblocksteam/shared";
2
+ export function getStableScopeId(scopeName) {
3
+ return generatePredictableId(`sc-${scopeName}`);
4
+ }
5
+ //# sourceMappingURL=scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scope.js","sourceRoot":"","sources":["../src/scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,qBAAqB,CAAC,MAAM,SAAS,EAAE,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { ApiTriggerType, BaseBlock } from "@superblocksteam/shared";
2
+ export type RemoveMeIApiV3Dto = {
3
+ id: string;
4
+ name: string;
5
+ applicationId: string;
6
+ pageId: string;
7
+ organizationId: string;
8
+ updated: Date | undefined;
9
+ triggerType: ApiTriggerType;
10
+ apiPb: {
11
+ metadata: {
12
+ name: string;
13
+ id: string;
14
+ organization: string;
15
+ timestamps?: {
16
+ updated?: string;
17
+ };
18
+ };
19
+ blocks?: BaseBlock[];
20
+ trigger?: {
21
+ application?: {
22
+ id: string;
23
+ pageId: string;
24
+ };
25
+ };
26
+ };
27
+ };
28
+ //# sourceMappingURL=apis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["../../src/types/apis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEzE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,SAAS,CAAC;IAC1B,WAAW,EAAE,cAAc,CAAC;IAC5B,KAAK,EAAE;QACL,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,YAAY,EAAE,MAAM,CAAC;YACrB,UAAU,CAAC,EAAE;gBACX,OAAO,CAAC,EAAE,MAAM,CAAC;aAClB,CAAC;SACH,CAAC;QACF,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;QACrB,OAAO,CAAC,EAAE;YACR,WAAW,CAAC,EAAE;gBACZ,EAAE,EAAE,MAAM,CAAC;gBACX,MAAM,EAAE,MAAM,CAAC;aAChB,CAAC;SACH,CAAC;KACH,CAAC;CACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=apis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apis.js","sourceRoot":"","sources":["../../src/types/apis.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export type Handler<Input, Output> = (input: Input) => Output;
2
+ export type SbElement = `SB-${string}`;
3
+ export type SbInstance = `I-${string}`;
4
+ export interface SourceLocation {
5
+ id: SbElement;
6
+ index?: number;
7
+ }
8
+ export type PayloadAction<P = void, T extends string = string, M = never, E = never> = {
9
+ payload: P;
10
+ type: T;
11
+ } & ([M] extends [never] ? object : {
12
+ meta: M;
13
+ }) & ([E] extends [never] ? object : {
14
+ error: E;
15
+ });
16
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC;AAE9D,MAAM,MAAM,SAAS,GAAG,MAAM,MAAM,EAAE,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG,KAAK,MAAM,EAAE,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,SAAS,CAAC;IAEd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,aAAa,CACvB,CAAC,GAAG,IAAI,EACR,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,CAAC,GAAG,KAAK,EACT,CAAC,GAAG,KAAK,IACP;IACF,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;CACT,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GACpB,MAAM,GACN;IACE,IAAI,EAAE,CAAC,CAAC;CACT,CAAC,GACJ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAChB,MAAM,GACN;IACE,KAAK,EAAE,CAAC,CAAC;CACV,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":""}