@verbb/plugin-kit-react 1.0.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.
- package/CHANGELOG.md +5 -0
- package/LICENSE.md +21 -0
- package/README.md +31 -0
- package/dist/_virtual/_rolldown/runtime.js +34 -0
- package/dist/components/Button.d.ts +26 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +148 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/ButtonGroup.d.ts +11 -0
- package/dist/components/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup.js +59 -0
- package/dist/components/ButtonGroup.js.map +1 -0
- package/dist/components/Calendar.d.ts +11 -0
- package/dist/components/Calendar.d.ts.map +1 -0
- package/dist/components/Calendar.js +133 -0
- package/dist/components/Calendar.js.map +1 -0
- package/dist/components/Checkbox.d.ts +5 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox.js +41 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/CheckboxInput.d.ts +14 -0
- package/dist/components/CheckboxInput.d.ts.map +1 -0
- package/dist/components/CheckboxInput.js +31 -0
- package/dist/components/CheckboxInput.js.map +1 -0
- package/dist/components/CheckboxSelect.d.ts +19 -0
- package/dist/components/CheckboxSelect.d.ts.map +1 -0
- package/dist/components/CheckboxSelect.js +63 -0
- package/dist/components/CheckboxSelect.js.map +1 -0
- package/dist/components/ColorInput.d.ts +14 -0
- package/dist/components/ColorInput.d.ts.map +1 -0
- package/dist/components/ColorInput.js +148 -0
- package/dist/components/ColorInput.js.map +1 -0
- package/dist/components/Combobox.d.ts +40 -0
- package/dist/components/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox.js +393 -0
- package/dist/components/Combobox.js.map +1 -0
- package/dist/components/ComboboxInput.d.ts +28 -0
- package/dist/components/ComboboxInput.d.ts.map +1 -0
- package/dist/components/ComboboxInput.js +165 -0
- package/dist/components/ComboboxInput.js.map +1 -0
- package/dist/components/Command.d.ts +26 -0
- package/dist/components/Command.d.ts.map +1 -0
- package/dist/components/Command.js +94 -0
- package/dist/components/Command.js.map +1 -0
- package/dist/components/CopyButton.d.ts +9 -0
- package/dist/components/CopyButton.d.ts.map +1 -0
- package/dist/components/CopyButton.js +40 -0
- package/dist/components/CopyButton.js.map +1 -0
- package/dist/components/DatePicker.d.ts +9 -0
- package/dist/components/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker.js +46 -0
- package/dist/components/DatePicker.js.map +1 -0
- package/dist/components/Dialog.d.ts +21 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/Dialog.js +179 -0
- package/dist/components/Dialog.js.map +1 -0
- package/dist/components/DropdownMenu.d.ts +47 -0
- package/dist/components/DropdownMenu.d.ts.map +1 -0
- package/dist/components/DropdownMenu.js +240 -0
- package/dist/components/DropdownMenu.js.map +1 -0
- package/dist/components/EditableTable.d.ts +28 -0
- package/dist/components/EditableTable.d.ts.map +1 -0
- package/dist/components/EditableTable.js +145 -0
- package/dist/components/EditableTable.js.map +1 -0
- package/dist/components/FadeIn.d.ts +12 -0
- package/dist/components/FadeIn.d.ts.map +1 -0
- package/dist/components/FadeIn.js +24 -0
- package/dist/components/FadeIn.js.map +1 -0
- package/dist/components/Input.d.ts +9 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +43 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/InputGroup.d.ts +20 -0
- package/dist/components/InputGroup.d.ts.map +1 -0
- package/dist/components/InputGroup.js +111 -0
- package/dist/components/InputGroup.js.map +1 -0
- package/dist/components/Label.d.ts +4 -0
- package/dist/components/Label.d.ts.map +1 -0
- package/dist/components/Label.js +15 -0
- package/dist/components/Label.js.map +1 -0
- package/dist/components/Lightswitch.d.ts +9 -0
- package/dist/components/Lightswitch.d.ts.map +1 -0
- package/dist/components/Lightswitch.js +56 -0
- package/dist/components/Lightswitch.js.map +1 -0
- package/dist/components/Markdown.d.ts +11 -0
- package/dist/components/Markdown.d.ts.map +1 -0
- package/dist/components/Markdown.js +46 -0
- package/dist/components/Markdown.js.map +1 -0
- package/dist/components/MenuButton.d.ts +40 -0
- package/dist/components/MenuButton.d.ts.map +1 -0
- package/dist/components/MenuButton.js +122 -0
- package/dist/components/MenuButton.js.map +1 -0
- package/dist/components/ModalTabs.d.ts +8 -0
- package/dist/components/ModalTabs.d.ts.map +1 -0
- package/dist/components/ModalTabs.js +37 -0
- package/dist/components/ModalTabs.js.map +1 -0
- package/dist/components/PaneTabs.d.ts +8 -0
- package/dist/components/PaneTabs.d.ts.map +1 -0
- package/dist/components/PaneTabs.js +37 -0
- package/dist/components/PaneTabs.js.map +1 -0
- package/dist/components/Popover.d.ts +12 -0
- package/dist/components/Popover.d.ts.map +1 -0
- package/dist/components/Popover.js +70 -0
- package/dist/components/Popover.js.map +1 -0
- package/dist/components/RadioGroup.d.ts +6 -0
- package/dist/components/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup.js +34 -0
- package/dist/components/RadioGroup.js.map +1 -0
- package/dist/components/ScrollArea.d.ts +16 -0
- package/dist/components/ScrollArea.d.ts.map +1 -0
- package/dist/components/ScrollArea.js +47 -0
- package/dist/components/ScrollArea.js.map +1 -0
- package/dist/components/Select.d.ts +23 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +205 -0
- package/dist/components/Select.js.map +1 -0
- package/dist/components/SelectInput.d.ts +33 -0
- package/dist/components/SelectInput.d.ts.map +1 -0
- package/dist/components/SelectInput.js +85 -0
- package/dist/components/SelectInput.js.map +1 -0
- package/dist/components/Separator.d.ts +4 -0
- package/dist/components/Separator.d.ts.map +1 -0
- package/dist/components/Separator.js +17 -0
- package/dist/components/Separator.js.map +1 -0
- package/dist/components/SlideUp.d.ts +12 -0
- package/dist/components/SlideUp.d.ts.map +1 -0
- package/dist/components/SlideUp.js +36 -0
- package/dist/components/SlideUp.js.map +1 -0
- package/dist/components/Slot.d.ts +6 -0
- package/dist/components/Slot.d.ts.map +1 -0
- package/dist/components/Slot.js +52 -0
- package/dist/components/Slot.js.map +1 -0
- package/dist/components/Spinner.d.ts +9 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +43 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/components/Status.d.ts +8 -0
- package/dist/components/Status.d.ts.map +1 -0
- package/dist/components/Status.js +55 -0
- package/dist/components/Status.js.map +1 -0
- package/dist/components/Table.d.ts +10 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Table.js +64 -0
- package/dist/components/Table.js.map +1 -0
- package/dist/components/Tabs.d.ts +8 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs.js +37 -0
- package/dist/components/Tabs.js.map +1 -0
- package/dist/components/Textarea.d.ts +8 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +26 -0
- package/dist/components/Textarea.js.map +1 -0
- package/dist/components/TimePicker.d.ts +9 -0
- package/dist/components/TimePicker.d.ts.map +1 -0
- package/dist/components/TimePicker.js +40 -0
- package/dist/components/TimePicker.js.map +1 -0
- package/dist/components/TiptapContent.d.ts +9 -0
- package/dist/components/TiptapContent.d.ts.map +1 -0
- package/dist/components/TiptapContent.js +24 -0
- package/dist/components/TiptapContent.js.map +1 -0
- package/dist/components/TiptapEditor.d.ts +41 -0
- package/dist/components/TiptapEditor.d.ts.map +1 -0
- package/dist/components/TiptapEditor.js +555 -0
- package/dist/components/TiptapEditor.js.map +1 -0
- package/dist/components/TiptapInput.d.ts +15 -0
- package/dist/components/TiptapInput.d.ts.map +1 -0
- package/dist/components/TiptapInput.js +138 -0
- package/dist/components/TiptapInput.js.map +1 -0
- package/dist/components/Toggle.d.ts +9 -0
- package/dist/components/Toggle.d.ts.map +1 -0
- package/dist/components/Toggle.js +48 -0
- package/dist/components/Toggle.js.map +1 -0
- package/dist/components/ToggleGroup.d.ts +11 -0
- package/dist/components/ToggleGroup.d.ts.map +1 -0
- package/dist/components/ToggleGroup.js +70 -0
- package/dist/components/ToggleGroup.js.map +1 -0
- package/dist/components/Tooltip.d.ts +9 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +51 -0
- package/dist/components/Tooltip.js.map +1 -0
- package/dist/components/VirtualizedScrollArea.d.ts +25 -0
- package/dist/components/VirtualizedScrollArea.d.ts.map +1 -0
- package/dist/components/VirtualizedScrollArea.js +80 -0
- package/dist/components/VirtualizedScrollArea.js.map +1 -0
- package/dist/components/editable-table/RowDataCells.d.ts +3 -0
- package/dist/components/editable-table/RowDataCells.d.ts.map +1 -0
- package/dist/components/editable-table/RowDataCells.js +33 -0
- package/dist/components/editable-table/RowDataCells.js.map +1 -0
- package/dist/components/editable-table/TableCell.d.ts +13 -0
- package/dist/components/editable-table/TableCell.d.ts.map +1 -0
- package/dist/components/editable-table/TableCell.js +415 -0
- package/dist/components/editable-table/TableCell.js.map +1 -0
- package/dist/components/editable-table/TableRow.d.ts +3 -0
- package/dist/components/editable-table/TableRow.d.ts.map +1 -0
- package/dist/components/editable-table/TableRow.js +163 -0
- package/dist/components/editable-table/TableRow.js.map +1 -0
- package/dist/components/editable-table/helpers.d.ts +12 -0
- package/dist/components/editable-table/helpers.d.ts.map +1 -0
- package/dist/components/editable-table/helpers.js +23 -0
- package/dist/components/editable-table/helpers.js.map +1 -0
- package/dist/components/editable-table/index.d.ts +4 -0
- package/dist/components/editable-table/index.d.ts.map +1 -0
- package/dist/components/editable-table/index.js +4 -0
- package/dist/components/editable-table/types.d.ts +43 -0
- package/dist/components/editable-table/types.d.ts.map +1 -0
- package/dist/components/editable-table/types.js +0 -0
- package/dist/components/editable-table/useEditableTableCellChange.d.ts +17 -0
- package/dist/components/editable-table/useEditableTableCellChange.d.ts.map +1 -0
- package/dist/components/editable-table/useEditableTableCellChange.js +152 -0
- package/dist/components/editable-table/useEditableTableCellChange.js.map +1 -0
- package/dist/components/editable-table/useEditableTableDnd.d.ts +18 -0
- package/dist/components/editable-table/useEditableTableDnd.d.ts.map +1 -0
- package/dist/components/editable-table/useEditableTableDnd.js +55 -0
- package/dist/components/editable-table/useEditableTableDnd.js.map +1 -0
- package/dist/components/editable-table/useEditableTableRows.d.ts +17 -0
- package/dist/components/editable-table/useEditableTableRows.d.ts.map +1 -0
- package/dist/components/editable-table/useEditableTableRows.js +108 -0
- package/dist/components/editable-table/useEditableTableRows.js.map +1 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +45 -0
- package/dist/components/tiptap/InlineVariablePickerPopover.d.ts +24 -0
- package/dist/components/tiptap/InlineVariablePickerPopover.d.ts.map +1 -0
- package/dist/components/tiptap/InlineVariablePickerPopover.js +63 -0
- package/dist/components/tiptap/InlineVariablePickerPopover.js.map +1 -0
- package/dist/components/tiptap/InsertLinkDialog.d.ts +14 -0
- package/dist/components/tiptap/InsertLinkDialog.d.ts.map +1 -0
- package/dist/components/tiptap/InsertLinkDialog.js +145 -0
- package/dist/components/tiptap/InsertLinkDialog.js.map +1 -0
- package/dist/components/tiptap/LinkBubbleMenu.d.ts +10 -0
- package/dist/components/tiptap/LinkBubbleMenu.d.ts.map +1 -0
- package/dist/components/tiptap/LinkBubbleMenu.js +106 -0
- package/dist/components/tiptap/LinkBubbleMenu.js.map +1 -0
- package/dist/components/tiptap/LinkDropdown.d.ts +53 -0
- package/dist/components/tiptap/LinkDropdown.d.ts.map +1 -0
- package/dist/components/tiptap/LinkDropdown.js +155 -0
- package/dist/components/tiptap/LinkDropdown.js.map +1 -0
- package/dist/components/tiptap/VariableCommandList.d.ts +37 -0
- package/dist/components/tiptap/VariableCommandList.d.ts.map +1 -0
- package/dist/components/tiptap/VariableCommandList.js +166 -0
- package/dist/components/tiptap/VariableCommandList.js.map +1 -0
- package/dist/components/tiptap/VariableDropdown.d.ts +33 -0
- package/dist/components/tiptap/VariableDropdown.d.ts.map +1 -0
- package/dist/components/tiptap/VariableDropdown.js +121 -0
- package/dist/components/tiptap/VariableDropdown.js.map +1 -0
- package/dist/components/tiptap/VariablePickerContext.d.ts +38 -0
- package/dist/components/tiptap/VariablePickerContext.d.ts.map +1 -0
- package/dist/components/tiptap/VariablePickerContext.js +30 -0
- package/dist/components/tiptap/VariablePickerContext.js.map +1 -0
- package/dist/components/tiptap/VariableTag.d.ts +6 -0
- package/dist/components/tiptap/VariableTag.d.ts.map +1 -0
- package/dist/components/tiptap/VariableTag.js +153 -0
- package/dist/components/tiptap/VariableTag.js.map +1 -0
- package/dist/components/tiptap/VariableTagView.d.ts +3 -0
- package/dist/components/tiptap/VariableTagView.d.ts.map +1 -0
- package/dist/components/tiptap/VariableTagView.js +445 -0
- package/dist/components/tiptap/VariableTagView.js.map +1 -0
- package/dist/components/tiptap/VariableTransformControls.d.ts +37 -0
- package/dist/components/tiptap/VariableTransformControls.d.ts.map +1 -0
- package/dist/components/tiptap/VariableTransformControls.js +157 -0
- package/dist/components/tiptap/VariableTransformControls.js.map +1 -0
- package/dist/components/tiptap/editorConfig.d.ts +15 -0
- package/dist/components/tiptap/editorConfig.d.ts.map +1 -0
- package/dist/components/tiptap/editorConfig.js +191 -0
- package/dist/components/tiptap/editorConfig.js.map +1 -0
- package/dist/components/tiptap/useInlineVariablePicker.d.ts +34 -0
- package/dist/components/tiptap/useInlineVariablePicker.d.ts.map +1 -0
- package/dist/components/tiptap/useInlineVariablePicker.js +240 -0
- package/dist/components/tiptap/useInlineVariablePicker.js.map +1 -0
- package/dist/components/tiptap/useVariablePicker.d.ts +28 -0
- package/dist/components/tiptap/useVariablePicker.d.ts.map +1 -0
- package/dist/components/tiptap/useVariablePicker.js +122 -0
- package/dist/components/tiptap/useVariablePicker.js.map +1 -0
- package/dist/components/tiptap/variablePickerUtils.d.ts +11 -0
- package/dist/components/tiptap/variablePickerUtils.d.ts.map +1 -0
- package/dist/components/tiptap/variablePickerUtils.js +63 -0
- package/dist/components/tiptap/variablePickerUtils.js.map +1 -0
- package/dist/components/tiptap/variableSerialization.d.ts +49 -0
- package/dist/components/tiptap/variableSerialization.d.ts.map +1 -0
- package/dist/components/tiptap/variableSerialization.js +250 -0
- package/dist/components/tiptap/variableSerialization.js.map +1 -0
- package/dist/css/core.css +288 -0
- package/dist/css/style.css +295 -0
- package/dist/forms/Field.d.ts +37 -0
- package/dist/forms/Field.d.ts.map +1 -0
- package/dist/forms/Field.js +159 -0
- package/dist/forms/Field.js.map +1 -0
- package/dist/forms/SchemaFormEngine.d.ts +23 -0
- package/dist/forms/SchemaFormEngine.d.ts.map +1 -0
- package/dist/forms/SchemaFormEngine.js +444 -0
- package/dist/forms/SchemaFormEngine.js.map +1 -0
- package/dist/forms/components/FieldWrap.d.ts +11 -0
- package/dist/forms/components/FieldWrap.d.ts.map +1 -0
- package/dist/forms/components/FieldWrap.js +84 -0
- package/dist/forms/components/FieldWrap.js.map +1 -0
- package/dist/forms/components/ModalTabs.d.ts +21 -0
- package/dist/forms/components/ModalTabs.d.ts.map +1 -0
- package/dist/forms/components/ModalTabs.js +84 -0
- package/dist/forms/components/ModalTabs.js.map +1 -0
- package/dist/forms/components/index.d.ts +3 -0
- package/dist/forms/components/index.d.ts.map +1 -0
- package/dist/forms/components/index.js +3 -0
- package/dist/forms/contexts/VariableCategoriesContext.d.ts +17 -0
- package/dist/forms/contexts/VariableCategoriesContext.d.ts.map +1 -0
- package/dist/forms/contexts/VariableCategoriesContext.js +18 -0
- package/dist/forms/contexts/VariableCategoriesContext.js.map +1 -0
- package/dist/forms/engine/FormStateStore.d.ts +24 -0
- package/dist/forms/engine/FormStateStore.d.ts.map +1 -0
- package/dist/forms/engine/FormStateStore.js +97 -0
- package/dist/forms/engine/FormStateStore.js.map +1 -0
- package/dist/forms/engine/SchemaIndex.d.ts +33 -0
- package/dist/forms/engine/SchemaIndex.d.ts.map +1 -0
- package/dist/forms/engine/SchemaIndex.js +21 -0
- package/dist/forms/engine/SchemaIndex.js.map +1 -0
- package/dist/forms/engine/ValidationEngine.d.ts +13 -0
- package/dist/forms/engine/ValidationEngine.d.ts.map +1 -0
- package/dist/forms/engine/ValidationEngine.js +155 -0
- package/dist/forms/engine/ValidationEngine.js.map +1 -0
- package/dist/forms/engine/buildGroupedMessage.d.ts +2 -0
- package/dist/forms/engine/buildGroupedMessage.d.ts.map +1 -0
- package/dist/forms/engine/buildGroupedMessage.js +20 -0
- package/dist/forms/engine/buildGroupedMessage.js.map +1 -0
- package/dist/forms/engine/context.d.ts +60 -0
- package/dist/forms/engine/context.d.ts.map +1 -0
- package/dist/forms/engine/context.js +12 -0
- package/dist/forms/engine/context.js.map +1 -0
- package/dist/forms/engine/rules/email.d.ts +2 -0
- package/dist/forms/engine/rules/email.d.ts.map +1 -0
- package/dist/forms/engine/rules/email.js +11 -0
- package/dist/forms/engine/rules/email.js.map +1 -0
- package/dist/forms/engine/rules/emailOrVariable.d.ts +2 -0
- package/dist/forms/engine/rules/emailOrVariable.d.ts.map +1 -0
- package/dist/forms/engine/rules/emailOrVariable.js +13 -0
- package/dist/forms/engine/rules/emailOrVariable.js.map +1 -0
- package/dist/forms/engine/rules/handle.d.ts +2 -0
- package/dist/forms/engine/rules/handle.d.ts.map +1 -0
- package/dist/forms/engine/rules/handle.js +12 -0
- package/dist/forms/engine/rules/handle.js.map +1 -0
- package/dist/forms/engine/rules/index.d.ts +9 -0
- package/dist/forms/engine/rules/index.d.ts.map +1 -0
- package/dist/forms/engine/rules/index.js +35 -0
- package/dist/forms/engine/rules/index.js.map +1 -0
- package/dist/forms/engine/rules/max.d.ts +2 -0
- package/dist/forms/engine/rules/max.d.ts.map +1 -0
- package/dist/forms/engine/rules/max.js +16 -0
- package/dist/forms/engine/rules/max.js.map +1 -0
- package/dist/forms/engine/rules/min.d.ts +2 -0
- package/dist/forms/engine/rules/min.d.ts.map +1 -0
- package/dist/forms/engine/rules/min.js +16 -0
- package/dist/forms/engine/rules/min.js.map +1 -0
- package/dist/forms/engine/rules/required.d.ts +2 -0
- package/dist/forms/engine/rules/required.d.ts.map +1 -0
- package/dist/forms/engine/rules/required.js +11 -0
- package/dist/forms/engine/rules/required.js.map +1 -0
- package/dist/forms/engine/rules/uniqueHandle.d.ts +9 -0
- package/dist/forms/engine/rules/uniqueHandle.d.ts.map +1 -0
- package/dist/forms/engine/rules/uniqueHandle.js +95 -0
- package/dist/forms/engine/rules/uniqueHandle.js.map +1 -0
- package/dist/forms/engine/rules/utils.d.ts +3 -0
- package/dist/forms/engine/rules/utils.d.ts.map +1 -0
- package/dist/forms/engine/rules/utils.js +21 -0
- package/dist/forms/engine/rules/utils.js.map +1 -0
- package/dist/forms/fields/CalculationsField.d.ts +24 -0
- package/dist/forms/fields/CalculationsField.d.ts.map +1 -0
- package/dist/forms/fields/CalculationsField.js +215 -0
- package/dist/forms/fields/CalculationsField.js.map +1 -0
- package/dist/forms/fields/CalculationsToolbar.d.ts +17 -0
- package/dist/forms/fields/CalculationsToolbar.d.ts.map +1 -0
- package/dist/forms/fields/CalculationsToolbar.js +130 -0
- package/dist/forms/fields/CalculationsToolbar.js.map +1 -0
- package/dist/forms/fields/CheckboxSelectField.d.ts +19 -0
- package/dist/forms/fields/CheckboxSelectField.d.ts.map +1 -0
- package/dist/forms/fields/CheckboxSelectField.js +30 -0
- package/dist/forms/fields/CheckboxSelectField.js.map +1 -0
- package/dist/forms/fields/ColorField.d.ts +15 -0
- package/dist/forms/fields/ColorField.d.ts.map +1 -0
- package/dist/forms/fields/ColorField.js +30 -0
- package/dist/forms/fields/ColorField.js.map +1 -0
- package/dist/forms/fields/ComboboxField.d.ts +23 -0
- package/dist/forms/fields/ComboboxField.d.ts.map +1 -0
- package/dist/forms/fields/ComboboxField.js +38 -0
- package/dist/forms/fields/ComboboxField.js.map +1 -0
- package/dist/forms/fields/DateTimeField.d.ts +14 -0
- package/dist/forms/fields/DateTimeField.d.ts.map +1 -0
- package/dist/forms/fields/DateTimeField.js +53 -0
- package/dist/forms/fields/DateTimeField.js.map +1 -0
- package/dist/forms/fields/EditableTableField.d.ts +22 -0
- package/dist/forms/fields/EditableTableField.d.ts.map +1 -0
- package/dist/forms/fields/EditableTableField.js +37 -0
- package/dist/forms/fields/EditableTableField.js.map +1 -0
- package/dist/forms/fields/ElementSelectField.d.ts +20 -0
- package/dist/forms/fields/ElementSelectField.d.ts.map +1 -0
- package/dist/forms/fields/ElementSelectField.js +215 -0
- package/dist/forms/fields/ElementSelectField.js.map +1 -0
- package/dist/forms/fields/GroupField.d.ts +19 -0
- package/dist/forms/fields/GroupField.d.ts.map +1 -0
- package/dist/forms/fields/GroupField.js +50 -0
- package/dist/forms/fields/GroupField.js.map +1 -0
- package/dist/forms/fields/HandleField.d.ts +20 -0
- package/dist/forms/fields/HandleField.d.ts.map +1 -0
- package/dist/forms/fields/HandleField.js +70 -0
- package/dist/forms/fields/HandleField.js.map +1 -0
- package/dist/forms/fields/LightswitchField.d.ts +14 -0
- package/dist/forms/fields/LightswitchField.d.ts.map +1 -0
- package/dist/forms/fields/LightswitchField.js +29 -0
- package/dist/forms/fields/LightswitchField.js.map +1 -0
- package/dist/forms/fields/ListField.d.ts +17 -0
- package/dist/forms/fields/ListField.d.ts.map +1 -0
- package/dist/forms/fields/ListField.js +51 -0
- package/dist/forms/fields/ListField.js.map +1 -0
- package/dist/forms/fields/NumberField.d.ts +17 -0
- package/dist/forms/fields/NumberField.d.ts.map +1 -0
- package/dist/forms/fields/NumberField.js +33 -0
- package/dist/forms/fields/NumberField.js.map +1 -0
- package/dist/forms/fields/RadioGroupField.d.ts +25 -0
- package/dist/forms/fields/RadioGroupField.d.ts.map +1 -0
- package/dist/forms/fields/RadioGroupField.js +102 -0
- package/dist/forms/fields/RadioGroupField.js.map +1 -0
- package/dist/forms/fields/RichTextField.d.ts +23 -0
- package/dist/forms/fields/RichTextField.d.ts.map +1 -0
- package/dist/forms/fields/RichTextField.js +50 -0
- package/dist/forms/fields/RichTextField.js.map +1 -0
- package/dist/forms/fields/SelectField.d.ts +25 -0
- package/dist/forms/fields/SelectField.d.ts.map +1 -0
- package/dist/forms/fields/SelectField.js +73 -0
- package/dist/forms/fields/SelectField.js.map +1 -0
- package/dist/forms/fields/StaticTableField.d.ts +34 -0
- package/dist/forms/fields/StaticTableField.d.ts.map +1 -0
- package/dist/forms/fields/StaticTableField.js +128 -0
- package/dist/forms/fields/StaticTableField.js.map +1 -0
- package/dist/forms/fields/TextField.d.ts +16 -0
- package/dist/forms/fields/TextField.d.ts.map +1 -0
- package/dist/forms/fields/TextField.js +31 -0
- package/dist/forms/fields/TextField.js.map +1 -0
- package/dist/forms/fields/TextareaField.d.ts +17 -0
- package/dist/forms/fields/TextareaField.d.ts.map +1 -0
- package/dist/forms/fields/TextareaField.js +32 -0
- package/dist/forms/fields/TextareaField.js.map +1 -0
- package/dist/forms/fields/VariablePickerField.d.ts +21 -0
- package/dist/forms/fields/VariablePickerField.d.ts.map +1 -0
- package/dist/forms/fields/VariablePickerField.js +49 -0
- package/dist/forms/fields/VariablePickerField.js.map +1 -0
- package/dist/forms/index.d.ts +8 -0
- package/dist/forms/index.d.ts.map +1 -0
- package/dist/forms/index.js +10 -0
- package/dist/forms/registry.d.ts +8 -0
- package/dist/forms/registry.d.ts.map +1 -0
- package/dist/forms/registry.js +76 -0
- package/dist/forms/registry.js.map +1 -0
- package/dist/forms/store/element-store.d.ts +11 -0
- package/dist/forms/store/element-store.d.ts.map +1 -0
- package/dist/forms/store/element-store.js +41 -0
- package/dist/forms/store/element-store.js.map +1 -0
- package/dist/forms/useEditableTableFieldBinding.d.ts +13 -0
- package/dist/forms/useEditableTableFieldBinding.d.ts.map +1 -0
- package/dist/forms/useEditableTableFieldBinding.js +91 -0
- package/dist/forms/useEditableTableFieldBinding.js.map +1 -0
- package/dist/forms/useEngineField.d.ts +9 -0
- package/dist/forms/useEngineField.d.ts.map +1 -0
- package/dist/forms/useEngineField.js +32 -0
- package/dist/forms/useEngineField.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts +14 -0
- package/dist/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/hooks/useKeyboardShortcuts.js +67 -0
- package/dist/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/hooks/useTranslation.d.ts +3 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -0
- package/dist/hooks/useTranslation.js +12 -0
- package/dist/hooks/useTranslation.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/node_modules/@babel/runtime/helpers/arrayLikeToArray.js +15 -0
- package/dist/node_modules/@babel/runtime/helpers/arrayLikeToArray.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js +15 -0
- package/dist/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/classCallCheck.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/classCallCheck.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/createClass.js +21 -0
- package/dist/node_modules/@babel/runtime/helpers/createClass.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/defineProperty.js +20 -0
- package/dist/node_modules/@babel/runtime/helpers/defineProperty.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/interopRequireDefault.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/interopRequireDefault.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/iterableToArray.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/iterableToArray.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/nonIterableSpread.js +13 -0
- package/dist/node_modules/@babel/runtime/helpers/nonIterableSpread.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/toConsumableArray.js +21 -0
- package/dist/node_modules/@babel/runtime/helpers/toConsumableArray.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/toPrimitive.js +22 -0
- package/dist/node_modules/@babel/runtime/helpers/toPrimitive.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/toPropertyKey.js +18 -0
- package/dist/node_modules/@babel/runtime/helpers/toPropertyKey.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/typeof.js +18 -0
- package/dist/node_modules/@babel/runtime/helpers/typeof.js.map +1 -0
- package/dist/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js +19 -0
- package/dist/node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js.map +1 -0
- package/dist/node_modules/jexl/dist/Expression.js +84 -0
- package/dist/node_modules/jexl/dist/Expression.js.map +1 -0
- package/dist/node_modules/jexl/dist/Jexl.js +165 -0
- package/dist/node_modules/jexl/dist/Jexl.js.map +1 -0
- package/dist/node_modules/jexl/dist/Lexer.js +152 -0
- package/dist/node_modules/jexl/dist/Lexer.js.map +1 -0
- package/dist/node_modules/jexl/dist/PromiseSync.js +87 -0
- package/dist/node_modules/jexl/dist/PromiseSync.js.map +1 -0
- package/dist/node_modules/jexl/dist/evaluator/Evaluator.js +98 -0
- package/dist/node_modules/jexl/dist/evaluator/Evaluator.js.map +1 -0
- package/dist/node_modules/jexl/dist/evaluator/handlers.js +162 -0
- package/dist/node_modules/jexl/dist/evaluator/handlers.js.map +1 -0
- package/dist/node_modules/jexl/dist/grammar.js +195 -0
- package/dist/node_modules/jexl/dist/grammar.js.map +1 -0
- package/dist/node_modules/jexl/dist/parser/Parser.js +135 -0
- package/dist/node_modules/jexl/dist/parser/Parser.js.map +1 -0
- package/dist/node_modules/jexl/dist/parser/handlers.js +205 -0
- package/dist/node_modules/jexl/dist/parser/handlers.js.map +1 -0
- package/dist/node_modules/jexl/dist/parser/states.js +158 -0
- package/dist/node_modules/jexl/dist/parser/states.js.map +1 -0
- package/dist/types/global.d.d.ts +1 -0
- package/dist/types/global.d.js +0 -0
- package/dist/utils/classes.d.ts +18 -0
- package/dist/utils/classes.d.ts.map +1 -0
- package/dist/utils/classes.js +25 -0
- package/dist/utils/classes.js.map +1 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +16 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/craftHostBridge.d.ts +16 -0
- package/dist/utils/craftHostBridge.d.ts.map +1 -0
- package/dist/utils/craftHostBridge.js +28 -0
- package/dist/utils/craftHostBridge.js.map +1 -0
- package/dist/utils/handle.d.ts +10 -0
- package/dist/utils/handle.d.ts.map +1 -0
- package/dist/utils/handle.js +51 -0
- package/dist/utils/handle.js.map +1 -0
- package/dist/utils/hostBridge.d.ts +40 -0
- package/dist/utils/hostBridge.d.ts.map +1 -0
- package/dist/utils/hostBridge.js +35 -0
- package/dist/utils/hostBridge.js.map +1 -0
- package/dist/utils/index.d.ts +18 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +66 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/portal.d.ts +17 -0
- package/dist/utils/portal.d.ts.map +1 -0
- package/dist/utils/portal.js +51 -0
- package/dist/utils/portal.js.map +1 -0
- package/dist/utils/schema.d.ts +17 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/schema.js +56 -0
- package/dist/utils/schema.js.map +1 -0
- package/dist/utils/schemaFieldNames.d.ts +2 -0
- package/dist/utils/schemaFieldNames.d.ts.map +1 -0
- package/dist/utils/schemaFieldNames.js +16 -0
- package/dist/utils/schemaFieldNames.js.map +1 -0
- package/dist/utils/schemaIndex.d.ts +6 -0
- package/dist/utils/schemaIndex.d.ts.map +1 -0
- package/dist/utils/schemaIndex.js +31 -0
- package/dist/utils/schemaIndex.js.map +1 -0
- package/dist/utils/schemaIndexCache.d.ts +6 -0
- package/dist/utils/schemaIndexCache.d.ts.map +1 -0
- package/dist/utils/schemaIndexCache.js +32 -0
- package/dist/utils/schemaIndexCache.js.map +1 -0
- package/dist/utils/schemaNormalize.d.ts +13 -0
- package/dist/utils/schemaNormalize.d.ts.map +1 -0
- package/dist/utils/schemaNormalize.js +17 -0
- package/dist/utils/schemaNormalize.js.map +1 -0
- package/dist/utils/store.d.ts +7 -0
- package/dist/utils/store.d.ts.map +1 -0
- package/dist/utils/store.js +6 -0
- package/dist/utils/store.js.map +1 -0
- package/dist/utils/timeOptions.d.ts +6 -0
- package/dist/utils/timeOptions.d.ts.map +1 -0
- package/dist/utils/timeOptions.js +42 -0
- package/dist/utils/timeOptions.js.map +1 -0
- package/dist/utils/tiptap.d.ts +13 -0
- package/dist/utils/tiptap.d.ts.map +1 -0
- package/dist/utils/tiptap.js +39 -0
- package/dist/utils/tiptap.js.map +1 -0
- package/dist/utils/translation.d.ts +5 -0
- package/dist/utils/translation.d.ts.map +1 -0
- package/dist/utils/translation.js +21 -0
- package/dist/utils/translation.js.map +1 -0
- package/dist/utils/validation.d.ts +4 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +253 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +167 -0
- package/vite-dev.mjs +56 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Parser.js","names":[],"sources":["../../../../../../node_modules/jexl/dist/parser/Parser.js"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _classCallCheck2 = _interopRequireDefault(require(\"@babel/runtime/helpers/classCallCheck\"));\n\nvar _createClass2 = _interopRequireDefault(require(\"@babel/runtime/helpers/createClass\"));\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar handlers = require('./handlers');\n\nvar states = require('./states').states;\n/**\n * The Parser is a state machine that converts tokens from the {@link Lexer}\n * into an Abstract Syntax Tree (AST), capable of being evaluated in any\n * context by the {@link Evaluator}. The Parser expects that all tokens\n * provided to it are legal and typed properly according to the grammar, but\n * accepts that the tokens may still be in an invalid order or in some other\n * unparsable configuration that requires it to throw an Error.\n * @param {{}} grammar The grammar object to use to parse Jexl strings\n * @param {string} [prefix] A string prefix to prepend to the expression string\n * for error messaging purposes. This is useful for when a new Parser is\n * instantiated to parse an subexpression, as the parent Parser's\n * expression string thus far can be passed for a more user-friendly\n * error message.\n * @param {{}} [stopMap] A mapping of token types to any truthy value. When the\n * token type is encountered, the parser will return the mapped value\n * instead of boolean false.\n */\n\n\nvar Parser = /*#__PURE__*/function () {\n function Parser(grammar, prefix, stopMap) {\n (0, _classCallCheck2.default)(this, Parser);\n this._grammar = grammar;\n this._state = 'expectOperand';\n this._tree = null;\n this._exprStr = prefix || '';\n this._relative = false;\n this._stopMap = stopMap || {};\n }\n /**\n * Processes a new token into the AST and manages the transitions of the state\n * machine.\n * @param {{type: <string>}} token A token object, as provided by the\n * {@link Lexer#tokenize} function.\n * @throws {Error} if a token is added when the Parser has been marked as\n * complete by {@link #complete}, or if an unexpected token type is added.\n * @returns {boolean|*} the stopState value if this parser encountered a token\n * in the stopState mapb false if tokens can continue.\n */\n\n\n (0, _createClass2.default)(Parser, [{\n key: \"addToken\",\n value: function addToken(token) {\n if (this._state === 'complete') {\n throw new Error('Cannot add a new token to a completed Parser');\n }\n\n var state = states[this._state];\n var startExpr = this._exprStr;\n this._exprStr += token.raw;\n\n if (state.subHandler) {\n if (!this._subParser) {\n this._startSubExpression(startExpr);\n }\n\n var stopState = this._subParser.addToken(token);\n\n if (stopState) {\n this._endSubExpression();\n\n if (this._parentStop) return stopState;\n this._state = stopState;\n }\n } else if (state.tokenTypes[token.type]) {\n var typeOpts = state.tokenTypes[token.type];\n var handleFunc = handlers[token.type];\n\n if (typeOpts.handler) {\n handleFunc = typeOpts.handler;\n }\n\n if (handleFunc) {\n handleFunc.call(this, token);\n }\n\n if (typeOpts.toState) {\n this._state = typeOpts.toState;\n }\n } else if (this._stopMap[token.type]) {\n return this._stopMap[token.type];\n } else {\n throw new Error(\"Token \".concat(token.raw, \" (\").concat(token.type, \") unexpected in expression: \").concat(this._exprStr));\n }\n\n return false;\n }\n /**\n * Processes an array of tokens iteratively through the {@link #addToken}\n * function.\n * @param {Array<{type: <string>}>} tokens An array of tokens, as provided by\n * the {@link Lexer#tokenize} function.\n */\n\n }, {\n key: \"addTokens\",\n value: function addTokens(tokens) {\n tokens.forEach(this.addToken, this);\n }\n /**\n * Marks this Parser instance as completed and retrieves the full AST.\n * @returns {{}|null} a full expression tree, ready for evaluation by the\n * {@link Evaluator#eval} function, or null if no tokens were passed to\n * the parser before complete was called\n * @throws {Error} if the parser is not in a state where it's legal to end\n * the expression, indicating that the expression is incomplete\n */\n\n }, {\n key: \"complete\",\n value: function complete() {\n if (this._cursor && !states[this._state].completable) {\n throw new Error(\"Unexpected end of expression: \".concat(this._exprStr));\n }\n\n if (this._subParser) {\n this._endSubExpression();\n }\n\n this._state = 'complete';\n return this._cursor ? this._tree : null;\n }\n /**\n * Indicates whether the expression tree contains a relative path identifier.\n * @returns {boolean} true if a relative identifier exists false otherwise.\n */\n\n }, {\n key: \"isRelative\",\n value: function isRelative() {\n return this._relative;\n }\n /**\n * Ends a subexpression by completing the subParser and passing its result\n * to the subHandler configured in the current state.\n * @private\n */\n\n }, {\n key: \"_endSubExpression\",\n value: function _endSubExpression() {\n states[this._state].subHandler.call(this, this._subParser.complete());\n\n this._subParser = null;\n }\n /**\n * Places a new tree node at the current position of the cursor (to the 'right'\n * property) and then advances the cursor to the new node. This function also\n * handles setting the parent of the new node.\n * @param {{type: <string>}} node A node to be added to the AST\n * @private\n */\n\n }, {\n key: \"_placeAtCursor\",\n value: function _placeAtCursor(node) {\n if (!this._cursor) {\n this._tree = node;\n } else {\n this._cursor.right = node;\n\n this._setParent(node, this._cursor);\n }\n\n this._cursor = node;\n }\n /**\n * Places a tree node before the current position of the cursor, replacing\n * the node that the cursor currently points to. This should only be called in\n * cases where the cursor is known to exist, and the provided node already\n * contains a pointer to what's at the cursor currently.\n * @param {{type: <string>}} node A node to be added to the AST\n * @private\n */\n\n }, {\n key: \"_placeBeforeCursor\",\n value: function _placeBeforeCursor(node) {\n this._cursor = this._cursor._parent;\n\n this._placeAtCursor(node);\n }\n /**\n * Sets the parent of a node by creating a non-enumerable _parent property\n * that points to the supplied parent argument.\n * @param {{type: <string>}} node A node of the AST on which to set a new\n * parent\n * @param {{type: <string>}} parent An existing node of the AST to serve as the\n * parent of the new node\n * @private\n */\n\n }, {\n key: \"_setParent\",\n value: function _setParent(node, parent) {\n Object.defineProperty(node, '_parent', {\n value: parent,\n writable: true\n });\n }\n /**\n * Prepares the Parser to accept a subexpression by (re)instantiating the\n * subParser.\n * @param {string} [exprStr] The expression string to prefix to the new Parser\n * @private\n */\n\n }, {\n key: \"_startSubExpression\",\n value: function _startSubExpression(exprStr) {\n var endStates = states[this._state].endStates;\n\n if (!endStates) {\n this._parentStop = true;\n endStates = this._stopMap;\n }\n\n this._subParser = new Parser(this._grammar, exprStr, endStates);\n }\n }]);\n return Parser;\n}();\n\nmodule.exports = Parser;"],"x_google_ignoreList":[0],"mappings":";;;;;;;;CAEA,IAAI,yBAAA,+BAAA;CAEJ,IAAI,mBAAmB,uBAAA,wBAAA,CAAwE;CAE/F,IAAI,gBAAgB,uBAAA,qBAAA,CAAqE;CAMzF,IAAI,WAAA,kBAAA;CAEJ,IAAI,SAAA,gBAAA,CAA6B;AAiOjC,QAAO,UAAU,gBA7MS,WAAY;EACpC,SAAS,OAAO,SAAS,QAAQ,SAAS;AACxC,IAAC,GAAG,iBAAiB,SAAS,MAAM,OAAO;AAC3C,QAAK,WAAW;AAChB,QAAK,SAAS;AACd,QAAK,QAAQ;AACb,QAAK,WAAW,UAAU;AAC1B,QAAK,YAAY;AACjB,QAAK,WAAW,WAAW,EAAE;;;;;;;;;;;;AAc/B,GAAC,GAAG,cAAc,SAAS,QAAQ;GAAC;IAClC,KAAK;IACL,OAAO,SAAS,SAAS,OAAO;AAC9B,SAAI,KAAK,WAAW,WAClB,OAAM,IAAI,MAAM,+CAA+C;KAGjE,IAAI,QAAQ,OAAO,KAAK;KACxB,IAAI,YAAY,KAAK;AACrB,UAAK,YAAY,MAAM;AAEvB,SAAI,MAAM,YAAY;AACpB,UAAI,CAAC,KAAK,WACR,MAAK,oBAAoB,UAAU;MAGrC,IAAI,YAAY,KAAK,WAAW,SAAS,MAAM;AAE/C,UAAI,WAAW;AACb,YAAK,mBAAmB;AAExB,WAAI,KAAK,YAAa,QAAO;AAC7B,YAAK,SAAS;;gBAEP,MAAM,WAAW,MAAM,OAAO;MACvC,IAAI,WAAW,MAAM,WAAW,MAAM;MACtC,IAAI,aAAa,SAAS,MAAM;AAEhC,UAAI,SAAS,QACX,cAAa,SAAS;AAGxB,UAAI,WACF,YAAW,KAAK,MAAM,MAAM;AAG9B,UAAI,SAAS,QACX,MAAK,SAAS,SAAS;gBAEhB,KAAK,SAAS,MAAM,MAC7B,QAAO,KAAK,SAAS,MAAM;SAE3B,OAAM,IAAI,MAAM,SAAS,OAAO,MAAM,KAAK,KAAK,CAAC,OAAO,MAAM,MAAM,+BAA+B,CAAC,OAAO,KAAK,SAAS,CAAC;AAG5H,YAAO;;IASV;GAAE;IACD,KAAK;IACL,OAAO,SAAS,UAAU,QAAQ;AAChC,YAAO,QAAQ,KAAK,UAAU,KAAK;;IAWtC;GAAE;IACD,KAAK;IACL,OAAO,SAAS,WAAW;AACzB,SAAI,KAAK,WAAW,CAAC,OAAO,KAAK,QAAQ,YACvC,OAAM,IAAI,MAAM,iCAAiC,OAAO,KAAK,SAAS,CAAC;AAGzE,SAAI,KAAK,WACP,MAAK,mBAAmB;AAG1B,UAAK,SAAS;AACd,YAAO,KAAK,UAAU,KAAK,QAAQ;;IAOtC;GAAE;IACD,KAAK;IACL,OAAO,SAAS,aAAa;AAC3B,YAAO,KAAK;;IAQf;GAAE;IACD,KAAK;IACL,OAAO,SAAS,oBAAoB;AAClC,YAAO,KAAK,QAAQ,WAAW,KAAK,MAAM,KAAK,WAAW,UAAU,CAAC;AAErE,UAAK,aAAa;;IAUrB;GAAE;IACD,KAAK;IACL,OAAO,SAAS,eAAe,MAAM;AACnC,SAAI,CAAC,KAAK,QACR,MAAK,QAAQ;UACR;AACL,WAAK,QAAQ,QAAQ;AAErB,WAAK,WAAW,MAAM,KAAK,QAAQ;;AAGrC,UAAK,UAAU;;IAWlB;GAAE;IACD,KAAK;IACL,OAAO,SAAS,mBAAmB,MAAM;AACvC,UAAK,UAAU,KAAK,QAAQ;AAE5B,UAAK,eAAe,KAAK;;IAY5B;GAAE;IACD,KAAK;IACL,OAAO,SAAS,WAAW,MAAM,QAAQ;AACvC,YAAO,eAAe,MAAM,WAAW;MACrC,OAAO;MACP,UAAU;MACX,CAAC;;IASL;GAAE;IACD,KAAK;IACL,OAAO,SAAS,oBAAoB,SAAS;KAC3C,IAAI,YAAY,OAAO,KAAK,QAAQ;AAEpC,SAAI,CAAC,WAAW;AACd,WAAK,cAAc;AACnB,kBAAY,KAAK;;AAGnB,UAAK,aAAa,IAAI,OAAO,KAAK,UAAU,SAAS,UAAU;;IAElE;GAAC,CAAC;AACH,SAAO;IAGQ"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region ../node_modules/jexl/dist/parser/handlers.js
|
|
3
|
+
var require_handlers = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
|
+
/**
|
|
5
|
+
* Handles a subexpression that's used to define a transform argument's value.
|
|
6
|
+
* @param {{type: <string>}} ast The subexpression tree
|
|
7
|
+
*/
|
|
8
|
+
exports.argVal = function(ast) {
|
|
9
|
+
if (ast) this._cursor.args.push(ast);
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Handles new array literals by adding them as a new node in the AST,
|
|
13
|
+
* initialized with an empty array.
|
|
14
|
+
*/
|
|
15
|
+
exports.arrayStart = function() {
|
|
16
|
+
this._placeAtCursor({
|
|
17
|
+
type: "ArrayLiteral",
|
|
18
|
+
value: []
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Handles a subexpression representing an element of an array literal.
|
|
23
|
+
* @param {{type: <string>}} ast The subexpression tree
|
|
24
|
+
*/
|
|
25
|
+
exports.arrayVal = function(ast) {
|
|
26
|
+
if (ast) this._cursor.value.push(ast);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Handles tokens of type 'binaryOp', indicating an operation that has two
|
|
30
|
+
* inputs: a left side and a right side.
|
|
31
|
+
* @param {{type: <string>}} token A token object
|
|
32
|
+
*/
|
|
33
|
+
exports.binaryOp = function(token) {
|
|
34
|
+
var precedence = this._grammar.elements[token.value].precedence || 0;
|
|
35
|
+
var parent = this._cursor._parent;
|
|
36
|
+
while (parent && parent.operator && this._grammar.elements[parent.operator].precedence >= precedence) {
|
|
37
|
+
this._cursor = parent;
|
|
38
|
+
parent = parent._parent;
|
|
39
|
+
}
|
|
40
|
+
var node = {
|
|
41
|
+
type: "BinaryExpression",
|
|
42
|
+
operator: token.value,
|
|
43
|
+
left: this._cursor
|
|
44
|
+
};
|
|
45
|
+
this._setParent(this._cursor, node);
|
|
46
|
+
this._cursor = parent;
|
|
47
|
+
this._placeAtCursor(node);
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Handles successive nodes in an identifier chain. More specifically, it
|
|
51
|
+
* sets values that determine how the following identifier gets placed in the
|
|
52
|
+
* AST.
|
|
53
|
+
*/
|
|
54
|
+
exports.dot = function() {
|
|
55
|
+
this._nextIdentEncapsulate = this._cursor && this._cursor.type !== "UnaryExpression" && (this._cursor.type !== "BinaryExpression" || this._cursor.type === "BinaryExpression" && this._cursor.right);
|
|
56
|
+
this._nextIdentRelative = !this._cursor || this._cursor && !this._nextIdentEncapsulate;
|
|
57
|
+
if (this._nextIdentRelative) this._relative = true;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Handles a subexpression used for filtering an array returned by an
|
|
61
|
+
* identifier chain.
|
|
62
|
+
* @param {{type: <string>}} ast The subexpression tree
|
|
63
|
+
*/
|
|
64
|
+
exports.filter = function(ast) {
|
|
65
|
+
this._placeBeforeCursor({
|
|
66
|
+
type: "FilterExpression",
|
|
67
|
+
expr: ast,
|
|
68
|
+
relative: this._subParser.isRelative(),
|
|
69
|
+
subject: this._cursor
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Handles identifier tokens when used to indicate the name of a function to
|
|
74
|
+
* be called.
|
|
75
|
+
* @param {{type: <string>}} token A token object
|
|
76
|
+
*/
|
|
77
|
+
exports.functionCall = function() {
|
|
78
|
+
this._placeBeforeCursor({
|
|
79
|
+
type: "FunctionCall",
|
|
80
|
+
name: this._cursor.value,
|
|
81
|
+
args: [],
|
|
82
|
+
pool: "functions"
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Handles identifier tokens by adding them as a new node in the AST.
|
|
87
|
+
* @param {{type: <string>}} token A token object
|
|
88
|
+
*/
|
|
89
|
+
exports.identifier = function(token) {
|
|
90
|
+
var node = {
|
|
91
|
+
type: "Identifier",
|
|
92
|
+
value: token.value
|
|
93
|
+
};
|
|
94
|
+
if (this._nextIdentEncapsulate) {
|
|
95
|
+
node.from = this._cursor;
|
|
96
|
+
this._placeBeforeCursor(node);
|
|
97
|
+
this._nextIdentEncapsulate = false;
|
|
98
|
+
} else {
|
|
99
|
+
if (this._nextIdentRelative) {
|
|
100
|
+
node.relative = true;
|
|
101
|
+
this._nextIdentRelative = false;
|
|
102
|
+
}
|
|
103
|
+
this._placeAtCursor(node);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Handles literal values, such as strings, booleans, and numerics, by adding
|
|
108
|
+
* them as a new node in the AST.
|
|
109
|
+
* @param {{type: <string>}} token A token object
|
|
110
|
+
*/
|
|
111
|
+
exports.literal = function(token) {
|
|
112
|
+
this._placeAtCursor({
|
|
113
|
+
type: "Literal",
|
|
114
|
+
value: token.value
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Queues a new object literal key to be written once a value is collected.
|
|
119
|
+
* @param {{type: <string>}} token A token object
|
|
120
|
+
*/
|
|
121
|
+
exports.objKey = function(token) {
|
|
122
|
+
this._curObjKey = token.value;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Handles new object literals by adding them as a new node in the AST,
|
|
126
|
+
* initialized with an empty object.
|
|
127
|
+
*/
|
|
128
|
+
exports.objStart = function() {
|
|
129
|
+
this._placeAtCursor({
|
|
130
|
+
type: "ObjectLiteral",
|
|
131
|
+
value: {}
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Handles an object value by adding its AST to the queued key on the object
|
|
136
|
+
* literal node currently at the cursor.
|
|
137
|
+
* @param {{type: <string>}} ast The subexpression tree
|
|
138
|
+
*/
|
|
139
|
+
exports.objVal = function(ast) {
|
|
140
|
+
this._cursor.value[this._curObjKey] = ast;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Handles traditional subexpressions, delineated with the groupStart and
|
|
144
|
+
* groupEnd elements.
|
|
145
|
+
* @param {{type: <string>}} ast The subexpression tree
|
|
146
|
+
*/
|
|
147
|
+
exports.subExpression = function(ast) {
|
|
148
|
+
this._placeAtCursor(ast);
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Handles a completed alternate subexpression of a ternary operator.
|
|
152
|
+
* @param {{type: <string>}} ast The subexpression tree
|
|
153
|
+
*/
|
|
154
|
+
exports.ternaryEnd = function(ast) {
|
|
155
|
+
this._cursor.alternate = ast;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Handles a completed consequent subexpression of a ternary operator.
|
|
159
|
+
* @param {{type: <string>}} ast The subexpression tree
|
|
160
|
+
*/
|
|
161
|
+
exports.ternaryMid = function(ast) {
|
|
162
|
+
this._cursor.consequent = ast;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Handles the start of a new ternary expression by encapsulating the entire
|
|
166
|
+
* AST in a ConditionalExpression node, and using the existing tree as the
|
|
167
|
+
* test element.
|
|
168
|
+
*/
|
|
169
|
+
exports.ternaryStart = function() {
|
|
170
|
+
this._tree = {
|
|
171
|
+
type: "ConditionalExpression",
|
|
172
|
+
test: this._tree
|
|
173
|
+
};
|
|
174
|
+
this._cursor = this._tree;
|
|
175
|
+
};
|
|
176
|
+
/**
|
|
177
|
+
* Handles identifier tokens when used to indicate the name of a transform to
|
|
178
|
+
* be applied.
|
|
179
|
+
* @param {{type: <string>}} token A token object
|
|
180
|
+
*/
|
|
181
|
+
exports.transform = function(token) {
|
|
182
|
+
this._placeBeforeCursor({
|
|
183
|
+
type: "FunctionCall",
|
|
184
|
+
name: token.value,
|
|
185
|
+
args: [this._cursor],
|
|
186
|
+
pool: "transforms"
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Handles token of type 'unaryOp', indicating that the operation has only
|
|
191
|
+
* one input: a right side.
|
|
192
|
+
* @param {{type: <string>}} token A token object
|
|
193
|
+
*/
|
|
194
|
+
exports.unaryOp = function(token) {
|
|
195
|
+
this._placeAtCursor({
|
|
196
|
+
type: "UnaryExpression",
|
|
197
|
+
operator: token.value
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
}));
|
|
201
|
+
//#endregion
|
|
202
|
+
export default require_handlers();
|
|
203
|
+
export { require_handlers };
|
|
204
|
+
|
|
205
|
+
//# sourceMappingURL=handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","names":[],"sources":["../../../../../../node_modules/jexl/dist/parser/handlers.js"],"sourcesContent":["\"use strict\";\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\n\n/**\n * Handles a subexpression that's used to define a transform argument's value.\n * @param {{type: <string>}} ast The subexpression tree\n */\nexports.argVal = function (ast) {\n if (ast) this._cursor.args.push(ast);\n};\n/**\n * Handles new array literals by adding them as a new node in the AST,\n * initialized with an empty array.\n */\n\n\nexports.arrayStart = function () {\n this._placeAtCursor({\n type: 'ArrayLiteral',\n value: []\n });\n};\n/**\n * Handles a subexpression representing an element of an array literal.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.arrayVal = function (ast) {\n if (ast) {\n this._cursor.value.push(ast);\n }\n};\n/**\n * Handles tokens of type 'binaryOp', indicating an operation that has two\n * inputs: a left side and a right side.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.binaryOp = function (token) {\n var precedence = this._grammar.elements[token.value].precedence || 0;\n var parent = this._cursor._parent;\n\n while (parent && parent.operator && this._grammar.elements[parent.operator].precedence >= precedence) {\n this._cursor = parent;\n parent = parent._parent;\n }\n\n var node = {\n type: 'BinaryExpression',\n operator: token.value,\n left: this._cursor\n };\n\n this._setParent(this._cursor, node);\n\n this._cursor = parent;\n\n this._placeAtCursor(node);\n};\n/**\n * Handles successive nodes in an identifier chain. More specifically, it\n * sets values that determine how the following identifier gets placed in the\n * AST.\n */\n\n\nexports.dot = function () {\n this._nextIdentEncapsulate = this._cursor && this._cursor.type !== 'UnaryExpression' && (this._cursor.type !== 'BinaryExpression' || this._cursor.type === 'BinaryExpression' && this._cursor.right);\n this._nextIdentRelative = !this._cursor || this._cursor && !this._nextIdentEncapsulate;\n\n if (this._nextIdentRelative) {\n this._relative = true;\n }\n};\n/**\n * Handles a subexpression used for filtering an array returned by an\n * identifier chain.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.filter = function (ast) {\n this._placeBeforeCursor({\n type: 'FilterExpression',\n expr: ast,\n relative: this._subParser.isRelative(),\n subject: this._cursor\n });\n};\n/**\n * Handles identifier tokens when used to indicate the name of a function to\n * be called.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.functionCall = function () {\n this._placeBeforeCursor({\n type: 'FunctionCall',\n name: this._cursor.value,\n args: [],\n pool: 'functions'\n });\n};\n/**\n * Handles identifier tokens by adding them as a new node in the AST.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.identifier = function (token) {\n var node = {\n type: 'Identifier',\n value: token.value\n };\n\n if (this._nextIdentEncapsulate) {\n node.from = this._cursor;\n\n this._placeBeforeCursor(node);\n\n this._nextIdentEncapsulate = false;\n } else {\n if (this._nextIdentRelative) {\n node.relative = true;\n this._nextIdentRelative = false;\n }\n\n this._placeAtCursor(node);\n }\n};\n/**\n * Handles literal values, such as strings, booleans, and numerics, by adding\n * them as a new node in the AST.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.literal = function (token) {\n this._placeAtCursor({\n type: 'Literal',\n value: token.value\n });\n};\n/**\n * Queues a new object literal key to be written once a value is collected.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.objKey = function (token) {\n this._curObjKey = token.value;\n};\n/**\n * Handles new object literals by adding them as a new node in the AST,\n * initialized with an empty object.\n */\n\n\nexports.objStart = function () {\n this._placeAtCursor({\n type: 'ObjectLiteral',\n value: {}\n });\n};\n/**\n * Handles an object value by adding its AST to the queued key on the object\n * literal node currently at the cursor.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.objVal = function (ast) {\n this._cursor.value[this._curObjKey] = ast;\n};\n/**\n * Handles traditional subexpressions, delineated with the groupStart and\n * groupEnd elements.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.subExpression = function (ast) {\n this._placeAtCursor(ast);\n};\n/**\n * Handles a completed alternate subexpression of a ternary operator.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.ternaryEnd = function (ast) {\n this._cursor.alternate = ast;\n};\n/**\n * Handles a completed consequent subexpression of a ternary operator.\n * @param {{type: <string>}} ast The subexpression tree\n */\n\n\nexports.ternaryMid = function (ast) {\n this._cursor.consequent = ast;\n};\n/**\n * Handles the start of a new ternary expression by encapsulating the entire\n * AST in a ConditionalExpression node, and using the existing tree as the\n * test element.\n */\n\n\nexports.ternaryStart = function () {\n this._tree = {\n type: 'ConditionalExpression',\n test: this._tree\n };\n this._cursor = this._tree;\n};\n/**\n * Handles identifier tokens when used to indicate the name of a transform to\n * be applied.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.transform = function (token) {\n this._placeBeforeCursor({\n type: 'FunctionCall',\n name: token.value,\n args: [this._cursor],\n pool: 'transforms'\n });\n};\n/**\n * Handles token of type 'unaryOp', indicating that the operation has only\n * one input: a right side.\n * @param {{type: <string>}} token A token object\n */\n\n\nexports.unaryOp = function (token) {\n this._placeAtCursor({\n type: 'UnaryExpression',\n operator: token.value\n });\n};"],"x_google_ignoreList":[0],"mappings":";;;;;;;AAWA,SAAQ,SAAS,SAAU,KAAK;AAC9B,MAAI,IAAK,MAAK,QAAQ,KAAK,KAAK,IAAI;;;;;;AAQtC,SAAQ,aAAa,WAAY;AAC/B,OAAK,eAAe;GAClB,MAAM;GACN,OAAO,EAAE;GACV,CAAC;;;;;;AAQJ,SAAQ,WAAW,SAAU,KAAK;AAChC,MAAI,IACF,MAAK,QAAQ,MAAM,KAAK,IAAI;;;;;;;AAUhC,SAAQ,WAAW,SAAU,OAAO;EAClC,IAAI,aAAa,KAAK,SAAS,SAAS,MAAM,OAAO,cAAc;EACnE,IAAI,SAAS,KAAK,QAAQ;AAE1B,SAAO,UAAU,OAAO,YAAY,KAAK,SAAS,SAAS,OAAO,UAAU,cAAc,YAAY;AACpG,QAAK,UAAU;AACf,YAAS,OAAO;;EAGlB,IAAI,OAAO;GACT,MAAM;GACN,UAAU,MAAM;GAChB,MAAM,KAAK;GACZ;AAED,OAAK,WAAW,KAAK,SAAS,KAAK;AAEnC,OAAK,UAAU;AAEf,OAAK,eAAe,KAAK;;;;;;;AAS3B,SAAQ,MAAM,WAAY;AACxB,OAAK,wBAAwB,KAAK,WAAW,KAAK,QAAQ,SAAS,sBAAsB,KAAK,QAAQ,SAAS,sBAAsB,KAAK,QAAQ,SAAS,sBAAsB,KAAK,QAAQ;AAC9L,OAAK,qBAAqB,CAAC,KAAK,WAAW,KAAK,WAAW,CAAC,KAAK;AAEjE,MAAI,KAAK,mBACP,MAAK,YAAY;;;;;;;AAUrB,SAAQ,SAAS,SAAU,KAAK;AAC9B,OAAK,mBAAmB;GACtB,MAAM;GACN,MAAM;GACN,UAAU,KAAK,WAAW,YAAY;GACtC,SAAS,KAAK;GACf,CAAC;;;;;;;AASJ,SAAQ,eAAe,WAAY;AACjC,OAAK,mBAAmB;GACtB,MAAM;GACN,MAAM,KAAK,QAAQ;GACnB,MAAM,EAAE;GACR,MAAM;GACP,CAAC;;;;;;AAQJ,SAAQ,aAAa,SAAU,OAAO;EACpC,IAAI,OAAO;GACT,MAAM;GACN,OAAO,MAAM;GACd;AAED,MAAI,KAAK,uBAAuB;AAC9B,QAAK,OAAO,KAAK;AAEjB,QAAK,mBAAmB,KAAK;AAE7B,QAAK,wBAAwB;SACxB;AACL,OAAI,KAAK,oBAAoB;AAC3B,SAAK,WAAW;AAChB,SAAK,qBAAqB;;AAG5B,QAAK,eAAe,KAAK;;;;;;;;AAU7B,SAAQ,UAAU,SAAU,OAAO;AACjC,OAAK,eAAe;GAClB,MAAM;GACN,OAAO,MAAM;GACd,CAAC;;;;;;AAQJ,SAAQ,SAAS,SAAU,OAAO;AAChC,OAAK,aAAa,MAAM;;;;;;AAQ1B,SAAQ,WAAW,WAAY;AAC7B,OAAK,eAAe;GAClB,MAAM;GACN,OAAO,EAAE;GACV,CAAC;;;;;;;AASJ,SAAQ,SAAS,SAAU,KAAK;AAC9B,OAAK,QAAQ,MAAM,KAAK,cAAc;;;;;;;AASxC,SAAQ,gBAAgB,SAAU,KAAK;AACrC,OAAK,eAAe,IAAI;;;;;;AAQ1B,SAAQ,aAAa,SAAU,KAAK;AAClC,OAAK,QAAQ,YAAY;;;;;;AAQ3B,SAAQ,aAAa,SAAU,KAAK;AAClC,OAAK,QAAQ,aAAa;;;;;;;AAS5B,SAAQ,eAAe,WAAY;AACjC,OAAK,QAAQ;GACX,MAAM;GACN,MAAM,KAAK;GACZ;AACD,OAAK,UAAU,KAAK;;;;;;;AAStB,SAAQ,YAAY,SAAU,OAAO;AACnC,OAAK,mBAAmB;GACtB,MAAM;GACN,MAAM,MAAM;GACZ,MAAM,CAAC,KAAK,QAAQ;GACpB,MAAM;GACP,CAAC;;;;;;;AASJ,SAAQ,UAAU,SAAU,OAAO;AACjC,OAAK,eAAe;GAClB,MAAM;GACN,UAAU,MAAM;GACjB,CAAC"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_handlers } from "./handlers.js";
|
|
3
|
+
//#region ../node_modules/jexl/dist/parser/states.js
|
|
4
|
+
var require_states = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
+
var h = require_handlers();
|
|
6
|
+
/**
|
|
7
|
+
* A mapping of all states in the finite state machine to a set of instructions
|
|
8
|
+
* for handling or transitioning into other states. Each state can be handled
|
|
9
|
+
* in one of two schemes: a tokenType map, or a subHandler.
|
|
10
|
+
*
|
|
11
|
+
* Standard expression elements are handled through the tokenType object. This
|
|
12
|
+
* is an object map of all legal token types to encounter in this state (and
|
|
13
|
+
* any unexpected token types will generate a thrown error) to an options
|
|
14
|
+
* object that defines how they're handled. The available options are:
|
|
15
|
+
*
|
|
16
|
+
* {string} toState: The name of the state to which to transition
|
|
17
|
+
* immediately after handling this token
|
|
18
|
+
* {string} handler: The handler function to call when this token type is
|
|
19
|
+
* encountered in this state. If omitted, the default handler
|
|
20
|
+
* matching the token's "type" property will be called. If the handler
|
|
21
|
+
* function does not exist, no call will be made and no error will be
|
|
22
|
+
* generated. This is useful for tokens whose sole purpose is to
|
|
23
|
+
* transition to other states.
|
|
24
|
+
*
|
|
25
|
+
* States that consume a subexpression should define a subHandler, the
|
|
26
|
+
* function to be called with an expression tree argument when the
|
|
27
|
+
* subexpression is complete. Completeness is determined through the
|
|
28
|
+
* endStates object, which maps tokens on which an expression should end to the
|
|
29
|
+
* state to which to transition once the subHandler function has been called.
|
|
30
|
+
*
|
|
31
|
+
* Additionally, any state in which it is legal to mark the AST as completed
|
|
32
|
+
* should have a 'completable' property set to boolean true. Attempting to
|
|
33
|
+
* call {@link Parser#complete} in any state without this property will result
|
|
34
|
+
* in a thrown Error.
|
|
35
|
+
*
|
|
36
|
+
* @type {{}}
|
|
37
|
+
*/
|
|
38
|
+
exports.states = {
|
|
39
|
+
expectOperand: { tokenTypes: {
|
|
40
|
+
literal: { toState: "expectBinOp" },
|
|
41
|
+
identifier: { toState: "identifier" },
|
|
42
|
+
unaryOp: {},
|
|
43
|
+
openParen: { toState: "subExpression" },
|
|
44
|
+
openCurl: {
|
|
45
|
+
toState: "expectObjKey",
|
|
46
|
+
handler: h.objStart
|
|
47
|
+
},
|
|
48
|
+
dot: { toState: "traverse" },
|
|
49
|
+
openBracket: {
|
|
50
|
+
toState: "arrayVal",
|
|
51
|
+
handler: h.arrayStart
|
|
52
|
+
}
|
|
53
|
+
} },
|
|
54
|
+
expectBinOp: {
|
|
55
|
+
tokenTypes: {
|
|
56
|
+
binaryOp: { toState: "expectOperand" },
|
|
57
|
+
pipe: { toState: "expectTransform" },
|
|
58
|
+
dot: { toState: "traverse" },
|
|
59
|
+
question: {
|
|
60
|
+
toState: "ternaryMid",
|
|
61
|
+
handler: h.ternaryStart
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
completable: true
|
|
65
|
+
},
|
|
66
|
+
expectTransform: { tokenTypes: { identifier: {
|
|
67
|
+
toState: "postTransform",
|
|
68
|
+
handler: h.transform
|
|
69
|
+
} } },
|
|
70
|
+
expectObjKey: { tokenTypes: {
|
|
71
|
+
identifier: {
|
|
72
|
+
toState: "expectKeyValSep",
|
|
73
|
+
handler: h.objKey
|
|
74
|
+
},
|
|
75
|
+
closeCurl: { toState: "expectBinOp" }
|
|
76
|
+
} },
|
|
77
|
+
expectKeyValSep: { tokenTypes: { colon: { toState: "objVal" } } },
|
|
78
|
+
postTransform: {
|
|
79
|
+
tokenTypes: {
|
|
80
|
+
openParen: { toState: "argVal" },
|
|
81
|
+
binaryOp: { toState: "expectOperand" },
|
|
82
|
+
dot: { toState: "traverse" },
|
|
83
|
+
openBracket: { toState: "filter" },
|
|
84
|
+
pipe: { toState: "expectTransform" }
|
|
85
|
+
},
|
|
86
|
+
completable: true
|
|
87
|
+
},
|
|
88
|
+
postArgs: {
|
|
89
|
+
tokenTypes: {
|
|
90
|
+
binaryOp: { toState: "expectOperand" },
|
|
91
|
+
dot: { toState: "traverse" },
|
|
92
|
+
openBracket: { toState: "filter" },
|
|
93
|
+
pipe: { toState: "expectTransform" }
|
|
94
|
+
},
|
|
95
|
+
completable: true
|
|
96
|
+
},
|
|
97
|
+
identifier: {
|
|
98
|
+
tokenTypes: {
|
|
99
|
+
binaryOp: { toState: "expectOperand" },
|
|
100
|
+
dot: { toState: "traverse" },
|
|
101
|
+
openBracket: { toState: "filter" },
|
|
102
|
+
openParen: {
|
|
103
|
+
toState: "argVal",
|
|
104
|
+
handler: h.functionCall
|
|
105
|
+
},
|
|
106
|
+
pipe: { toState: "expectTransform" },
|
|
107
|
+
question: {
|
|
108
|
+
toState: "ternaryMid",
|
|
109
|
+
handler: h.ternaryStart
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
completable: true
|
|
113
|
+
},
|
|
114
|
+
traverse: { tokenTypes: { identifier: { toState: "identifier" } } },
|
|
115
|
+
filter: {
|
|
116
|
+
subHandler: h.filter,
|
|
117
|
+
endStates: { closeBracket: "identifier" }
|
|
118
|
+
},
|
|
119
|
+
subExpression: {
|
|
120
|
+
subHandler: h.subExpression,
|
|
121
|
+
endStates: { closeParen: "expectBinOp" }
|
|
122
|
+
},
|
|
123
|
+
argVal: {
|
|
124
|
+
subHandler: h.argVal,
|
|
125
|
+
endStates: {
|
|
126
|
+
comma: "argVal",
|
|
127
|
+
closeParen: "postArgs"
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
objVal: {
|
|
131
|
+
subHandler: h.objVal,
|
|
132
|
+
endStates: {
|
|
133
|
+
comma: "expectObjKey",
|
|
134
|
+
closeCurl: "expectBinOp"
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
arrayVal: {
|
|
138
|
+
subHandler: h.arrayVal,
|
|
139
|
+
endStates: {
|
|
140
|
+
comma: "arrayVal",
|
|
141
|
+
closeBracket: "expectBinOp"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
ternaryMid: {
|
|
145
|
+
subHandler: h.ternaryMid,
|
|
146
|
+
endStates: { colon: "ternaryEnd" }
|
|
147
|
+
},
|
|
148
|
+
ternaryEnd: {
|
|
149
|
+
subHandler: h.ternaryEnd,
|
|
150
|
+
completable: true
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
}));
|
|
154
|
+
//#endregion
|
|
155
|
+
export default require_states();
|
|
156
|
+
export { require_states };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"states.js","names":[],"sources":["../../../../../../node_modules/jexl/dist/parser/states.js"],"sourcesContent":["\"use strict\";\n\n/*\n * Jexl\n * Copyright 2020 Tom Shawver\n */\nvar h = require('./handlers');\n/**\n * A mapping of all states in the finite state machine to a set of instructions\n * for handling or transitioning into other states. Each state can be handled\n * in one of two schemes: a tokenType map, or a subHandler.\n *\n * Standard expression elements are handled through the tokenType object. This\n * is an object map of all legal token types to encounter in this state (and\n * any unexpected token types will generate a thrown error) to an options\n * object that defines how they're handled. The available options are:\n *\n * {string} toState: The name of the state to which to transition\n * immediately after handling this token\n * {string} handler: The handler function to call when this token type is\n * encountered in this state. If omitted, the default handler\n * matching the token's \"type\" property will be called. If the handler\n * function does not exist, no call will be made and no error will be\n * generated. This is useful for tokens whose sole purpose is to\n * transition to other states.\n *\n * States that consume a subexpression should define a subHandler, the\n * function to be called with an expression tree argument when the\n * subexpression is complete. Completeness is determined through the\n * endStates object, which maps tokens on which an expression should end to the\n * state to which to transition once the subHandler function has been called.\n *\n * Additionally, any state in which it is legal to mark the AST as completed\n * should have a 'completable' property set to boolean true. Attempting to\n * call {@link Parser#complete} in any state without this property will result\n * in a thrown Error.\n *\n * @type {{}}\n */\n\n\nexports.states = {\n expectOperand: {\n tokenTypes: {\n literal: {\n toState: 'expectBinOp'\n },\n identifier: {\n toState: 'identifier'\n },\n unaryOp: {},\n openParen: {\n toState: 'subExpression'\n },\n openCurl: {\n toState: 'expectObjKey',\n handler: h.objStart\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'arrayVal',\n handler: h.arrayStart\n }\n }\n },\n expectBinOp: {\n tokenTypes: {\n binaryOp: {\n toState: 'expectOperand'\n },\n pipe: {\n toState: 'expectTransform'\n },\n dot: {\n toState: 'traverse'\n },\n question: {\n toState: 'ternaryMid',\n handler: h.ternaryStart\n }\n },\n completable: true\n },\n expectTransform: {\n tokenTypes: {\n identifier: {\n toState: 'postTransform',\n handler: h.transform\n }\n }\n },\n expectObjKey: {\n tokenTypes: {\n identifier: {\n toState: 'expectKeyValSep',\n handler: h.objKey\n },\n closeCurl: {\n toState: 'expectBinOp'\n }\n }\n },\n expectKeyValSep: {\n tokenTypes: {\n colon: {\n toState: 'objVal'\n }\n }\n },\n postTransform: {\n tokenTypes: {\n openParen: {\n toState: 'argVal'\n },\n binaryOp: {\n toState: 'expectOperand'\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'filter'\n },\n pipe: {\n toState: 'expectTransform'\n }\n },\n completable: true\n },\n postArgs: {\n tokenTypes: {\n binaryOp: {\n toState: 'expectOperand'\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'filter'\n },\n pipe: {\n toState: 'expectTransform'\n }\n },\n completable: true\n },\n identifier: {\n tokenTypes: {\n binaryOp: {\n toState: 'expectOperand'\n },\n dot: {\n toState: 'traverse'\n },\n openBracket: {\n toState: 'filter'\n },\n openParen: {\n toState: 'argVal',\n handler: h.functionCall\n },\n pipe: {\n toState: 'expectTransform'\n },\n question: {\n toState: 'ternaryMid',\n handler: h.ternaryStart\n }\n },\n completable: true\n },\n traverse: {\n tokenTypes: {\n identifier: {\n toState: 'identifier'\n }\n }\n },\n filter: {\n subHandler: h.filter,\n endStates: {\n closeBracket: 'identifier'\n }\n },\n subExpression: {\n subHandler: h.subExpression,\n endStates: {\n closeParen: 'expectBinOp'\n }\n },\n argVal: {\n subHandler: h.argVal,\n endStates: {\n comma: 'argVal',\n closeParen: 'postArgs'\n }\n },\n objVal: {\n subHandler: h.objVal,\n endStates: {\n comma: 'expectObjKey',\n closeCurl: 'expectBinOp'\n }\n },\n arrayVal: {\n subHandler: h.arrayVal,\n endStates: {\n comma: 'arrayVal',\n closeBracket: 'expectBinOp'\n }\n },\n ternaryMid: {\n subHandler: h.ternaryMid,\n endStates: {\n colon: 'ternaryEnd'\n }\n },\n ternaryEnd: {\n subHandler: h.ternaryEnd,\n completable: true\n }\n};"],"x_google_ignoreList":[0],"mappings":";;;;CAMA,IAAI,IAAA,kBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCJ,SAAQ,SAAS;EACf,eAAe,EACb,YAAY;GACV,SAAS,EACP,SAAS,eACV;GACD,YAAY,EACV,SAAS,cACV;GACD,SAAS,EAAE;GACX,WAAW,EACT,SAAS,iBACV;GACD,UAAU;IACR,SAAS;IACT,SAAS,EAAE;IACZ;GACD,KAAK,EACH,SAAS,YACV;GACD,aAAa;IACX,SAAS;IACT,SAAS,EAAE;IACZ;GACF,EACF;EACD,aAAa;GACX,YAAY;IACV,UAAU,EACR,SAAS,iBACV;IACD,MAAM,EACJ,SAAS,mBACV;IACD,KAAK,EACH,SAAS,YACV;IACD,UAAU;KACR,SAAS;KACT,SAAS,EAAE;KACZ;IACF;GACD,aAAa;GACd;EACD,iBAAiB,EACf,YAAY,EACV,YAAY;GACV,SAAS;GACT,SAAS,EAAE;GACZ,EACF,EACF;EACD,cAAc,EACZ,YAAY;GACV,YAAY;IACV,SAAS;IACT,SAAS,EAAE;IACZ;GACD,WAAW,EACT,SAAS,eACV;GACF,EACF;EACD,iBAAiB,EACf,YAAY,EACV,OAAO,EACL,SAAS,UACV,EACF,EACF;EACD,eAAe;GACb,YAAY;IACV,WAAW,EACT,SAAS,UACV;IACD,UAAU,EACR,SAAS,iBACV;IACD,KAAK,EACH,SAAS,YACV;IACD,aAAa,EACX,SAAS,UACV;IACD,MAAM,EACJ,SAAS,mBACV;IACF;GACD,aAAa;GACd;EACD,UAAU;GACR,YAAY;IACV,UAAU,EACR,SAAS,iBACV;IACD,KAAK,EACH,SAAS,YACV;IACD,aAAa,EACX,SAAS,UACV;IACD,MAAM,EACJ,SAAS,mBACV;IACF;GACD,aAAa;GACd;EACD,YAAY;GACV,YAAY;IACV,UAAU,EACR,SAAS,iBACV;IACD,KAAK,EACH,SAAS,YACV;IACD,aAAa,EACX,SAAS,UACV;IACD,WAAW;KACT,SAAS;KACT,SAAS,EAAE;KACZ;IACD,MAAM,EACJ,SAAS,mBACV;IACD,UAAU;KACR,SAAS;KACT,SAAS,EAAE;KACZ;IACF;GACD,aAAa;GACd;EACD,UAAU,EACR,YAAY,EACV,YAAY,EACV,SAAS,cACV,EACF,EACF;EACD,QAAQ;GACN,YAAY,EAAE;GACd,WAAW,EACT,cAAc,cACf;GACF;EACD,eAAe;GACb,YAAY,EAAE;GACd,WAAW,EACT,YAAY,eACb;GACF;EACD,QAAQ;GACN,YAAY,EAAE;GACd,WAAW;IACT,OAAO;IACP,YAAY;IACb;GACF;EACD,QAAQ;GACN,YAAY,EAAE;GACd,WAAW;IACT,OAAO;IACP,WAAW;IACZ;GACF;EACD,UAAU;GACR,YAAY,EAAE;GACd,WAAW;IACT,OAAO;IACP,cAAc;IACf;GACF;EACD,YAAY;GACV,YAAY,EAAE;GACd,WAAW,EACT,OAAO,cACR;GACF;EACD,YAAY;GACV,YAAY,EAAE;GACd,aAAa;GACd;EACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
|
File without changes
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
/**
|
|
3
|
+
* Utility function to merge class names with Tailwind support
|
|
4
|
+
*
|
|
5
|
+
* Combines clsx for conditional class names with tailwind-merge for
|
|
6
|
+
* proper handling of Tailwind utility classes.
|
|
7
|
+
*
|
|
8
|
+
* @param inputs - Class names or conditional class name objects to merge
|
|
9
|
+
* @returns Merged class name string with proper Tailwind handling
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* cn('p-4', 'bg-red-500', { 'hidden': isHidden })
|
|
14
|
+
* // Returns: 'p-4 bg-red-500' or 'p-4 bg-red-500 hidden'
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
18
|
+
//# sourceMappingURL=classes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../src/utils/classes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
//#region src/utils/classes.ts
|
|
4
|
+
/**
|
|
5
|
+
* Utility function to merge class names with Tailwind support
|
|
6
|
+
*
|
|
7
|
+
* Combines clsx for conditional class names with tailwind-merge for
|
|
8
|
+
* proper handling of Tailwind utility classes.
|
|
9
|
+
*
|
|
10
|
+
* @param inputs - Class names or conditional class name objects to merge
|
|
11
|
+
* @returns Merged class name string with proper Tailwind handling
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* cn('p-4', 'bg-red-500', { 'hidden': isHidden })
|
|
16
|
+
* // Returns: 'p-4 bg-red-500' or 'p-4 bg-red-500 hidden'
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function cn(...inputs) {
|
|
20
|
+
return twMerge(clsx(inputs));
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { cn };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=classes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classes.js","names":[],"sources":["../../src/utils/classes.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Utility function to merge class names with Tailwind support\n *\n * Combines clsx for conditional class names with tailwind-merge for\n * proper handling of Tailwind utility classes.\n *\n * @param inputs - Class names or conditional class name objects to merge\n * @returns Merged class name string with proper Tailwind handling\n *\n * @example\n * ```ts\n * cn('p-4', 'bg-red-500', { 'hidden': isHidden })\n * // Returns: 'p-4 bg-red-500' or 'p-4 bg-red-500 hidden'\n * ```\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,SAAgB,GAAG,GAAG,QAAsB;AACxC,QAAO,QAAQ,KAAK,OAAO,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TranslateParams } from './translation';
|
|
2
|
+
import { PluginKitReactHostBridge } from './hostBridge';
|
|
3
|
+
type TranslateFunction = (category: string, message: string, params?: TranslateParams) => string;
|
|
4
|
+
export type PluginKitReactConfig = {
|
|
5
|
+
portalClassName?: string;
|
|
6
|
+
portalContainer?: HTMLElement | ShadowRoot | null;
|
|
7
|
+
shadowRootSelectors?: string[];
|
|
8
|
+
translationCategory?: string;
|
|
9
|
+
translate?: TranslateFunction;
|
|
10
|
+
hostBridge?: Partial<PluginKitReactHostBridge>;
|
|
11
|
+
};
|
|
12
|
+
export declare const configurePluginKitReact: (config: PluginKitReactConfig) => void;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAgD,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAE5E,KAAK,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,KAAK,MAAM,CAAC;AAEjG,MAAM,MAAM,oBAAoB,GAAG;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,IAAI,CAAC;IAClD,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAClD,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,oBAAoB,KAAG,IAwBtE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { setPortalClassName, setPortalContainer, setShadowRootSelectors } from "./portal.js";
|
|
2
|
+
import { setTranslateFunction, setTranslationCategory } from "./translation.js";
|
|
3
|
+
import { setHostBridge } from "./hostBridge.js";
|
|
4
|
+
//#region src/utils/config.ts
|
|
5
|
+
var configurePluginKitReact = (config) => {
|
|
6
|
+
if (config.portalClassName) setPortalClassName(config.portalClassName);
|
|
7
|
+
if (config.portalContainer) setPortalContainer(config.portalContainer);
|
|
8
|
+
if (config.shadowRootSelectors) setShadowRootSelectors(config.shadowRootSelectors);
|
|
9
|
+
if (config.translationCategory) setTranslationCategory(config.translationCategory);
|
|
10
|
+
if (config.translate) setTranslateFunction(config.translate);
|
|
11
|
+
if (config.hostBridge) setHostBridge(config.hostBridge);
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { configurePluginKitReact };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../../src/utils/config.ts"],"sourcesContent":["import { setPortalClassName, setPortalContainer, setShadowRootSelectors } from './portal';\nimport { setTranslationCategory, setTranslateFunction, type TranslateParams } from './translation';\nimport { setHostBridge, type PluginKitReactHostBridge } from './hostBridge';\n\ntype TranslateFunction = (category: string, message: string, params?: TranslateParams) => string;\n\nexport type PluginKitReactConfig = {\n portalClassName?: string;\n portalContainer?: HTMLElement | ShadowRoot | null;\n shadowRootSelectors?: string[];\n translationCategory?: string;\n translate?: TranslateFunction;\n hostBridge?: Partial<PluginKitReactHostBridge>;\n};\n\nexport const configurePluginKitReact = (config: PluginKitReactConfig): void => {\n if (config.portalClassName) {\n setPortalClassName(config.portalClassName);\n }\n\n if (config.portalContainer) {\n setPortalContainer(config.portalContainer);\n }\n\n if (config.shadowRootSelectors) {\n setShadowRootSelectors(config.shadowRootSelectors);\n }\n\n if (config.translationCategory) {\n setTranslationCategory(config.translationCategory);\n }\n\n if (config.translate) {\n setTranslateFunction(config.translate);\n }\n\n if (config.hostBridge) {\n setHostBridge(config.hostBridge);\n }\n};\n"],"mappings":";;;;AAeA,IAAa,2BAA2B,WAAuC;AAC3E,KAAI,OAAO,gBACP,oBAAmB,OAAO,gBAAgB;AAG9C,KAAI,OAAO,gBACP,oBAAmB,OAAO,gBAAgB;AAG9C,KAAI,OAAO,oBACP,wBAAuB,OAAO,oBAAoB;AAGtD,KAAI,OAAO,oBACP,wBAAuB,OAAO,oBAAoB;AAGtD,KAAI,OAAO,UACP,sBAAqB,OAAO,UAAU;AAG1C,KAAI,OAAO,WACP,eAAc,OAAO,WAAW"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HostElementSelectorOptions, HostRequestConfig, HostRequestMethod, PluginKitReactHostBridge } from './hostBridge';
|
|
2
|
+
type CraftApi = {
|
|
3
|
+
sendActionRequest: <T = unknown>(method: HostRequestMethod, action: string, requestConfig?: HostRequestConfig) => Promise<T>;
|
|
4
|
+
createElementSelectorModal: (elementType: string, options: HostElementSelectorOptions) => void;
|
|
5
|
+
formatDate: (date: Date) => string;
|
|
6
|
+
timepickerOptions?: Record<string, unknown>;
|
|
7
|
+
locale?: string;
|
|
8
|
+
};
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
Craft?: CraftApi;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export declare const createCraftHostBridge: () => Partial<PluginKitReactHostBridge>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=craftHostBridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"craftHostBridge.d.ts","sourceRoot":"","sources":["../../src/utils/craftHostBridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,0BAA0B,EAC1B,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EAC3B,MAAM,cAAc,CAAC;AAEtB,KAAK,QAAQ,GAAG;IACZ,iBAAiB,EAAE,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7H,0BAA0B,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC/F,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM;QACZ,KAAK,CAAC,EAAE,QAAQ,CAAC;KACpB;CACJ;AAUD,eAAO,MAAM,qBAAqB,QAAO,OAAO,CAAC,wBAAwB,CAkBxE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/utils/craftHostBridge.ts
|
|
2
|
+
var getCraft = () => {
|
|
3
|
+
if (!window.Craft) throw new Error("Craft host bridge is unavailable because window.Craft is not defined.");
|
|
4
|
+
return window.Craft;
|
|
5
|
+
};
|
|
6
|
+
var createCraftHostBridge = () => {
|
|
7
|
+
return {
|
|
8
|
+
request: (method, action, requestConfig = {}) => {
|
|
9
|
+
return getCraft().sendActionRequest(method, action, requestConfig);
|
|
10
|
+
},
|
|
11
|
+
openElementSelector: (elementType, options) => {
|
|
12
|
+
return getCraft().createElementSelectorModal(elementType, options);
|
|
13
|
+
},
|
|
14
|
+
formatDate: (date) => {
|
|
15
|
+
return getCraft().formatDate(date);
|
|
16
|
+
},
|
|
17
|
+
getTimepickerOptions: () => {
|
|
18
|
+
return getCraft().timepickerOptions || {};
|
|
19
|
+
},
|
|
20
|
+
getLocale: () => {
|
|
21
|
+
return getCraft().locale || "en-US";
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { createCraftHostBridge };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=craftHostBridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"craftHostBridge.js","names":[],"sources":["../../src/utils/craftHostBridge.ts"],"sourcesContent":["import type {\n HostElementSelectorOptions,\n HostRequestConfig,\n HostRequestMethod,\n PluginKitReactHostBridge,\n} from './hostBridge';\n\ntype CraftApi = {\n sendActionRequest: <T = unknown>(method: HostRequestMethod, action: string, requestConfig?: HostRequestConfig) => Promise<T>;\n createElementSelectorModal: (elementType: string, options: HostElementSelectorOptions) => void;\n formatDate: (date: Date) => string;\n timepickerOptions?: Record<string, unknown>;\n locale?: string;\n};\n\ndeclare global {\n interface Window {\n Craft?: CraftApi;\n }\n}\n\nconst getCraft = (): CraftApi => {\n if (!window.Craft) {\n throw new Error('Craft host bridge is unavailable because window.Craft is not defined.');\n }\n\n return window.Craft;\n};\n\nexport const createCraftHostBridge = (): Partial<PluginKitReactHostBridge> => {\n return {\n request: (method, action, requestConfig = {}) => {\n return getCraft().sendActionRequest(method, action, requestConfig);\n },\n openElementSelector: (elementType, options) => {\n return getCraft().createElementSelectorModal(elementType, options);\n },\n formatDate: (date) => {\n return getCraft().formatDate(date);\n },\n getTimepickerOptions: () => {\n return getCraft().timepickerOptions || {};\n },\n getLocale: () => {\n return getCraft().locale || 'en-US';\n },\n };\n};\n"],"mappings":";AAqBA,IAAM,iBAA2B;AAC7B,KAAI,CAAC,OAAO,MACR,OAAM,IAAI,MAAM,wEAAwE;AAG5F,QAAO,OAAO;;AAGlB,IAAa,8BAAiE;AAC1E,QAAO;EACH,UAAU,QAAQ,QAAQ,gBAAgB,EAAE,KAAK;AAC7C,UAAO,UAAU,CAAC,kBAAkB,QAAQ,QAAQ,cAAc;;EAEtE,sBAAsB,aAAa,YAAY;AAC3C,UAAO,UAAU,CAAC,2BAA2B,aAAa,QAAQ;;EAEtE,aAAa,SAAS;AAClB,UAAO,UAAU,CAAC,WAAW,KAAK;;EAEtC,4BAA4B;AACxB,UAAO,UAAU,CAAC,qBAAqB,EAAE;;EAE7C,iBAAiB;AACb,UAAO,UAAU,CAAC,UAAU;;EAEnC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const getDynamicReservedHandles: (values: Record<string, unknown>, reservedFieldValues?: string[]) => string[];
|
|
2
|
+
declare const buildUniqueHandleFromSource: ({ sourceValue, values, reservedHandles, reservedFieldValues, maxLength, }: {
|
|
3
|
+
sourceValue: unknown;
|
|
4
|
+
values?: Record<string, unknown>;
|
|
5
|
+
reservedHandles?: string[];
|
|
6
|
+
reservedFieldValues?: string[];
|
|
7
|
+
maxLength?: number;
|
|
8
|
+
}) => string;
|
|
9
|
+
export { buildUniqueHandleFromSource, getDynamicReservedHandles };
|
|
10
|
+
//# sourceMappingURL=handle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../src/utils/handle.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,yBAAyB,GAAI,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAqB,MAAM,EAAO,aAgBrG,CAAC;AAkDF,QAAA,MAAM,2BAA2B,GAAI,2EAMlC;IACC,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,WAMA,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { findUniqueHandle, generateHandle } from "@verbb/plugin-kit";
|
|
2
|
+
import { get } from "lodash-es";
|
|
3
|
+
//#region src/utils/handle.ts
|
|
4
|
+
var normalizeHandleSource = (value) => {
|
|
5
|
+
if (value == null) return "";
|
|
6
|
+
return String(value).replace(/\{[^}]*\}/g, " ").replace(/\s+/g, " ").trim();
|
|
7
|
+
};
|
|
8
|
+
var getDynamicReservedHandles = (values, reservedFieldValues = []) => {
|
|
9
|
+
const dynamicHandles = [];
|
|
10
|
+
reservedFieldValues.forEach((fieldPath) => {
|
|
11
|
+
const value = get(values, fieldPath);
|
|
12
|
+
if (value && typeof value === "string") {
|
|
13
|
+
const handleValue = generateHandle(normalizeHandleSource(value));
|
|
14
|
+
if (handleValue) dynamicHandles.push(handleValue);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return dynamicHandles;
|
|
18
|
+
};
|
|
19
|
+
var truncateHandle = (handle, maxLength) => {
|
|
20
|
+
if (!Number.isFinite(maxLength)) return handle;
|
|
21
|
+
const length = Math.max(Number(maxLength), 0);
|
|
22
|
+
return handle.slice(0, length);
|
|
23
|
+
};
|
|
24
|
+
var findUniqueHandleWithinMaxLength = (baseHandle, reservedHandles = [], maxLength) => {
|
|
25
|
+
if (!baseHandle) return "";
|
|
26
|
+
if (!Number.isFinite(maxLength)) return findUniqueHandle(baseHandle, reservedHandles);
|
|
27
|
+
const normalizedReserved = new Set((reservedHandles || []).map((handle) => {
|
|
28
|
+
return String(handle || "").toLowerCase();
|
|
29
|
+
}));
|
|
30
|
+
const truncatedBase = truncateHandle(baseHandle, maxLength);
|
|
31
|
+
if (!truncatedBase) return "";
|
|
32
|
+
if (!normalizedReserved.has(truncatedBase.toLowerCase())) return truncatedBase;
|
|
33
|
+
let suffix = 1;
|
|
34
|
+
while (suffix < 1e4) {
|
|
35
|
+
const suffixText = String(suffix);
|
|
36
|
+
const baseMaxLength = Math.max(Number(maxLength) - suffixText.length, 0);
|
|
37
|
+
const truncatedWithSuffix = `${truncatedBase.slice(0, baseMaxLength)}${suffixText}`;
|
|
38
|
+
if (!normalizedReserved.has(truncatedWithSuffix.toLowerCase())) return truncatedWithSuffix;
|
|
39
|
+
suffix += 1;
|
|
40
|
+
}
|
|
41
|
+
return truncatedBase;
|
|
42
|
+
};
|
|
43
|
+
var buildUniqueHandleFromSource = ({ sourceValue, values = {}, reservedHandles = [], reservedFieldValues = [], maxLength }) => {
|
|
44
|
+
const baseHandle = generateHandle(normalizeHandleSource(sourceValue));
|
|
45
|
+
const dynamicHandles = getDynamicReservedHandles(values, reservedFieldValues);
|
|
46
|
+
return findUniqueHandleWithinMaxLength(baseHandle, [...reservedHandles, ...dynamicHandles], maxLength);
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { buildUniqueHandleFromSource, getDynamicReservedHandles };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=handle.js.map
|