lumen-plus 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/Alert.svelte +1 -1
- package/dist/components/Autocomplete/Autocomplete.svelte +1 -1
- package/dist/components/Backtop/Backtop.svelte +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.svelte +1 -1
- package/dist/components/Button/Button.svelte +1 -1
- package/dist/components/Calendar/Calendar.svelte +1 -1
- package/dist/components/Carousel/Carousel.svelte +1 -1
- package/dist/components/Cascader/Cascader.svelte +2 -2
- package/dist/components/Checkbox/Checkbox.svelte +1 -1
- package/dist/components/Collapse/CollapseItem.svelte +1 -1
- package/dist/components/ColorPicker/ColorPicker.svelte +2 -2
- package/dist/components/DatePicker/DatePicker.svelte +2 -2
- package/dist/components/DateTimePicker/DateTimePicker.svelte +2 -2
- package/dist/components/Dialog/Dialog.svelte +1 -1
- package/dist/components/Drawer/Drawer.svelte +1 -1
- package/dist/components/Dropdown/Dropdown.svelte +1 -1
- package/dist/components/Image/Image.svelte +1 -1
- package/dist/components/Input/Input.svelte +1 -1
- package/dist/components/InputNumber/InputNumber.svelte +1 -1
- package/dist/components/InputTag/InputTag.svelte +1 -1
- package/dist/components/Loading/Loading.svelte +1 -1
- package/dist/components/Menu/Menu.svelte +1 -1
- package/dist/components/Message/MessageBox.svelte +1 -1
- package/dist/components/MessageBox/MessageBox.svelte +2 -2
- package/dist/components/Notification/Notification.svelte +1 -1
- package/dist/components/Pagination/Pagination.svelte +4 -4
- package/dist/components/Popconfirm/Popconfirm.svelte +2 -2
- package/dist/components/Result/Result.svelte +1 -1
- package/dist/components/Select/Select.svelte +2 -2
- package/dist/components/Slider/Slider.svelte +1 -1
- package/dist/components/Steps/Step.svelte +1 -1
- package/dist/components/Switch/Switch.svelte +1 -1
- package/dist/components/Table/Table.svelte +5 -5
- package/dist/components/Tabs/Tabs.svelte +1 -1
- package/dist/components/Tag/Tag.svelte +1 -1
- package/dist/components/Textarea/Textarea.svelte +1 -1
- package/dist/components/TimePicker/TimePicker.svelte +2 -2
- package/dist/components/Transfer/Transfer.svelte +2 -2
- package/dist/components/Tree/TreeNode.svelte +2 -2
- package/dist/components/TreeSelect/TreeSelect.svelte +4 -4
- package/dist/components/Upload/Upload.svelte +1 -1
- package/dist/index.js +2 -0
- package/dist/theme-chalk/_index.scss +69 -0
- package/dist/theme-chalk/_reset.scss +16 -0
- package/dist/theme-chalk/_variables.scss +91 -0
- package/dist/theme-chalk/affix.scss +8 -0
- package/dist/theme-chalk/alert.scss +140 -0
- package/dist/theme-chalk/autocomplete.scss +238 -0
- package/dist/theme-chalk/avatar.scss +49 -0
- package/dist/theme-chalk/backtop.scss +55 -0
- package/dist/theme-chalk/badge.scss +47 -0
- package/dist/theme-chalk/breadcrumb.scss +50 -0
- package/dist/theme-chalk/button.scss +472 -0
- package/dist/theme-chalk/calendar.scss +166 -0
- package/dist/theme-chalk/card.scss +70 -0
- package/dist/theme-chalk/carousel.scss +167 -0
- package/dist/theme-chalk/cascader.scss +265 -0
- package/dist/theme-chalk/checkbox.scss +127 -0
- package/dist/theme-chalk/collapse.scss +100 -0
- package/dist/theme-chalk/color-picker.scss +247 -0
- package/dist/theme-chalk/container.scss +79 -0
- package/dist/theme-chalk/date-picker.scss +352 -0
- package/dist/theme-chalk/date-time-picker.scss +396 -0
- package/dist/theme-chalk/descriptions.scss +160 -0
- package/dist/theme-chalk/dialog.scss +154 -0
- package/dist/theme-chalk/divider.scss +61 -0
- package/dist/theme-chalk/drawer.scss +211 -0
- package/dist/theme-chalk/dropdown.scss +230 -0
- package/dist/theme-chalk/empty.scss +36 -0
- package/dist/theme-chalk/form.scss +187 -0
- package/dist/theme-chalk/icon.scss +16 -0
- package/dist/theme-chalk/image.scss +171 -0
- package/dist/theme-chalk/input-number.scss +229 -0
- package/dist/theme-chalk/input-tag.scss +119 -0
- package/dist/theme-chalk/input.scss +249 -0
- package/dist/theme-chalk/link.scss +28 -0
- package/dist/theme-chalk/loading.scss +68 -0
- package/dist/theme-chalk/menu.scss +239 -0
- package/dist/theme-chalk/message.scss +150 -0
- package/dist/theme-chalk/messagebox.scss +76 -0
- package/dist/theme-chalk/mixins/_bem.scss +103 -0
- package/dist/theme-chalk/mixins/_function.scss +12 -0
- package/dist/theme-chalk/notification.scss +164 -0
- package/dist/theme-chalk/pagination.scss +130 -0
- package/dist/theme-chalk/pin-input.scss +192 -0
- package/dist/theme-chalk/popconfirm.scss +194 -0
- package/dist/theme-chalk/popover.scss +196 -0
- package/dist/theme-chalk/progress.scss +51 -0
- package/dist/theme-chalk/radio.scss +128 -0
- package/dist/theme-chalk/rating.scss +227 -0
- package/dist/theme-chalk/result.scss +80 -0
- package/dist/theme-chalk/segmented.scss +108 -0
- package/dist/theme-chalk/select.scss +301 -0
- package/dist/theme-chalk/skeleton.scss +113 -0
- package/dist/theme-chalk/slider.scss +259 -0
- package/dist/theme-chalk/space.scss +44 -0
- package/dist/theme-chalk/statistic.scss +49 -0
- package/dist/theme-chalk/steps.scss +255 -0
- package/dist/theme-chalk/switch.scss +277 -0
- package/dist/theme-chalk/table.scss +343 -0
- package/dist/theme-chalk/tabs.scss +433 -0
- package/dist/theme-chalk/tag.scss +143 -0
- package/dist/theme-chalk/textarea.scss +125 -0
- package/dist/theme-chalk/time-picker.scss +321 -0
- package/dist/theme-chalk/timeline.scss +119 -0
- package/dist/theme-chalk/tooltip.scss +165 -0
- package/dist/theme-chalk/transfer.scss +219 -0
- package/dist/theme-chalk/tree-select.scss +384 -0
- package/dist/theme-chalk/tree.scss +101 -0
- package/dist/theme-chalk/upload.scss +457 -0
- package/dist/theme-chalk/watermark.scss +30 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/node_modules/.bin/tsc +2 -0
- package/dist/utils/node_modules/.bin/tsserver +2 -0
- package/dist/utils/node_modules/svelte/LICENSE.md +7 -0
- package/dist/utils/node_modules/svelte/README.md +41 -0
- package/dist/utils/node_modules/svelte/compiler/index.js +1 -0
- package/dist/utils/node_modules/svelte/compiler/package.json +3 -0
- package/dist/utils/node_modules/svelte/package.json +184 -0
- package/dist/utils/node_modules/svelte/src/animate/index.js +78 -0
- package/dist/utils/node_modules/svelte/src/attachments/index.js +113 -0
- package/dist/utils/node_modules/svelte/src/compiler/errors.js +1719 -0
- package/dist/utils/node_modules/svelte/src/compiler/index.js +198 -0
- package/dist/utils/node_modules/svelte/src/compiler/legacy.js +632 -0
- package/dist/utils/node_modules/svelte/src/compiler/migrate/index.js +1996 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/acorn.js +198 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/index.js +326 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/read/context.js +116 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/read/expression.js +93 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/read/options.js +261 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/read/script.js +97 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/read/style.js +633 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/remove_typescript_nodes.js +180 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/state/element.js +877 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/state/fragment.js +17 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/state/tag.js +751 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/state/text.js +23 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/utils/bracket.js +213 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/utils/create.js +16 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/utils/entities.js +2234 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/utils/fuzzymatch.js +280 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/1-parse/utils/html.js +127 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/css/css-analyze.js +331 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/css/css-prune.js +1160 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/css/css-warn.js +47 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/css/utils.js +177 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/index.js +1283 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/utils/check_graph_for_cycles.js +47 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/AnimateDirective.js +15 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ArrowFunctionExpression.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/AssignmentExpression.js +31 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/AttachTag.js +17 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/Attribute.js +66 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/AwaitBlock.js +48 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/AwaitExpression.js +150 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/BindDirective.js +280 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/CallExpression.js +339 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ClassBody.js +156 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ClassDeclaration.js +25 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ClassDirective.js +13 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/Component.js +26 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ConstTag.js +45 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/DebugTag.js +15 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/EachBlock.js +97 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ExportDefaultDeclaration.js +20 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ExportNamedDeclaration.js +70 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ExportSpecifier.js +30 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ExpressionStatement.js +38 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ExpressionTag.js +26 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/Fragment.js +10 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/FunctionDeclaration.js +16 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/FunctionExpression.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/HtmlTag.js +19 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/Identifier.js +193 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/IfBlock.js +27 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/ImportDeclaration.js +31 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/KeyBlock.js +21 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/LabeledStatement.js +95 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/LetDirective.js +24 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/Literal.js +14 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/MemberExpression.js +28 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/NewExpression.js +17 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/OnDirective.js +28 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/PropertyDefinition.js +21 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/RegularElement.js +210 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/RenderTag.js +68 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SlotElement.js +42 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SnippetBlock.js +113 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SpreadAttribute.js +13 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SpreadElement.js +16 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/StyleDirective.js +39 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteBody.js +22 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteBoundary.js +30 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteComponent.js +18 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteDocument.js +24 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteElement.js +78 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteFragment.js +27 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteHead.js +18 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteSelf.js +36 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/SvelteWindow.js +24 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/TaggedTemplateExpression.js +16 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/TemplateElement.js +12 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/Text.js +52 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/TitleElement.js +21 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/TransitionDirective.js +19 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/UpdateExpression.js +29 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/UseDirective.js +18 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/VariableDeclarator.js +160 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/constants.js +319 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/a11y/index.js +977 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/attribute.js +125 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/component.js +177 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/element.js +160 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/fragment.js +15 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/function.js +24 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/snippets.js +17 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/special-element.js +16 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/2-analyze/visitors/shared/utils.js +301 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/transform-client.js +709 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/transform-template/fix-attribute-casing.js +18 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/transform-template/index.js +67 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/transform-template/template.js +162 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/utils.js +181 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/AnimateDirective.js +38 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/ArrowFunctionExpression.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/AssignmentExpression.js +225 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/AttachTag.js +26 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/Attribute.js +14 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/AwaitBlock.js +124 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/AwaitExpression.js +25 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/BinaryExpression.js +34 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/BindDirective.js +290 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/BlockStatement.js +32 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/BreakStatement.js +20 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/CallExpression.js +136 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/ClassBody.js +111 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/Comment.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/Component.js +12 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/ConstTag.js +134 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/DebugTag.js +28 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js +367 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/ExportNamedDeclaration.js +19 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/ExpressionStatement.js +20 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/ForOfStatement.js +25 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/Fragment.js +181 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/FunctionDeclaration.js +12 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/FunctionExpression.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/HtmlTag.js +49 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/Identifier.js +45 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/IfBlock.js +90 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/KeyBlock.js +39 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/LabeledStatement.js +64 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/LetDirective.js +55 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/MemberExpression.js +23 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/OnDirective.js +38 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/Program.js +153 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js +791 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/RenderTag.js +91 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SlotElement.js +94 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SnippetBlock.js +94 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SpreadAttribute.js +10 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBody.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteBoundary.js +126 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteComponent.js +13 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteDocument.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteElement.js +157 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteFragment.js +17 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteHead.js +23 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteSelf.js +13 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/SvelteWindow.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/TitleElement.js +48 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/TransitionDirective.js +41 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/UpdateExpression.js +55 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/UseDirective.js +49 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/VariableDeclaration.js +422 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/component.js +530 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/declarations.js +53 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js +263 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/events.js +176 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/fragment.js +185 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/function.js +17 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/special_element.js +22 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js +513 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/css/index.js +479 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/index.js +118 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/transform-server.js +423 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/AssignmentExpression.js +107 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/AwaitBlock.js +37 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/AwaitExpression.js +40 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/CallExpression.js +71 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/ClassBody.js +81 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/Component.js +12 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/ConstTag.js +49 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/DebugTag.js +24 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/EachBlock.js +80 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/ExpressionStatement.js +23 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/Fragment.js +53 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/HtmlTag.js +26 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/Identifier.js +19 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/IfBlock.js +39 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/KeyBlock.js +22 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/LabeledStatement.js +24 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/MemberExpression.js +19 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/Program.js +25 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/PropertyDefinition.js +37 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/RegularElement.js +255 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/RenderTag.js +51 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SlotElement.js +77 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SnippetBlock.js +29 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SpreadAttribute.js +10 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SvelteBoundary.js +71 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SvelteComponent.js +12 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SvelteElement.js +102 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SvelteFragment.js +11 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SvelteHead.js +25 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/SvelteSelf.js +12 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/TitleElement.js +21 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/UpdateExpression.js +26 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js +212 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/shared/component.js +360 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js +563 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/server/visitors/shared/utils.js +407 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/shared/assignments.js +93 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/shared/transform-async.js +114 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/3-transform/utils.js +451 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/bindings.js +227 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/css.js +14 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/nodes.js +245 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/patterns.js +27 -0
- package/dist/utils/node_modules/svelte/src/compiler/phases/scope.js +1412 -0
- package/dist/utils/node_modules/svelte/src/compiler/preprocess/decode_sourcemap.js +96 -0
- package/dist/utils/node_modules/svelte/src/compiler/preprocess/index.js +368 -0
- package/dist/utils/node_modules/svelte/src/compiler/preprocess/replace_in_code.js +72 -0
- package/dist/utils/node_modules/svelte/src/compiler/print/index.js +890 -0
- package/dist/utils/node_modules/svelte/src/compiler/state.js +144 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/assert.js +9 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/ast.js +639 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/builders.js +698 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/compile_diagnostic.js +107 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/extract_svelte_ignore.js +104 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/mapped_code.js +454 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/push_array.js +13 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/sanitize_template_string.js +7 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/slot.js +20 -0
- package/dist/utils/node_modules/svelte/src/compiler/utils/string.js +9 -0
- package/dist/utils/node_modules/svelte/src/compiler/validate-options.js +324 -0
- package/dist/utils/node_modules/svelte/src/compiler/warnings.js +845 -0
- package/dist/utils/node_modules/svelte/src/constants.js +64 -0
- package/dist/utils/node_modules/svelte/src/easing/index.js +286 -0
- package/dist/utils/node_modules/svelte/src/escaping.js +26 -0
- package/dist/utils/node_modules/svelte/src/events/index.js +1 -0
- package/dist/utils/node_modules/svelte/src/html-tree-validation.js +238 -0
- package/dist/utils/node_modules/svelte/src/index-client.js +255 -0
- package/dist/utils/node_modules/svelte/src/index-server.js +56 -0
- package/dist/utils/node_modules/svelte/src/internal/client/constants.js +73 -0
- package/dist/utils/node_modules/svelte/src/internal/client/context.js +258 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/assign.js +78 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/console-log.js +35 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/css.js +31 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/debug.js +500 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/elements.js +63 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/equality.js +101 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/hmr.js +89 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/inspect.js +72 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/legacy.js +25 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/ownership.js +81 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/tracing.js +162 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dev/validation.js +16 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/async.js +64 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/await.js +142 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/boundary.js +507 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/branches.js +227 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/css-props.js +28 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/each.js +666 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/html.js +121 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/if.js +70 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/key.js +33 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/slot.js +44 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/snippet.js +103 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/svelte-component.js +26 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/svelte-element.js +152 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/blocks/svelte-head.js +59 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/css.js +32 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/actions.js +43 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/attachments.js +33 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/attributes.js +657 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/document.js +17 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/input.js +312 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/media.js +232 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/navigator.js +11 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/props.js +22 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/select.js +159 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/shared.js +76 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/size.js +108 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/this.js +61 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/universal.js +75 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/bindings/window.js +66 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/class.js +51 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/custom-element.js +338 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/customizable-select.js +98 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/events.js +338 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/misc.js +58 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/style.js +57 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/elements/transitions.js +472 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/hydration.js +120 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/legacy/event-modifiers.js +127 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js +82 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/legacy/misc.js +68 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/operations.js +260 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/reconciler.js +6 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/task.js +42 -0
- package/dist/utils/node_modules/svelte/src/internal/client/dom/template.js +388 -0
- package/dist/utils/node_modules/svelte/src/internal/client/error-handling.js +116 -0
- package/dist/utils/node_modules/svelte/src/internal/client/errors.js +491 -0
- package/dist/utils/node_modules/svelte/src/internal/client/hydratable.js +33 -0
- package/dist/utils/node_modules/svelte/src/internal/client/index.js +184 -0
- package/dist/utils/node_modules/svelte/src/internal/client/legacy.js +46 -0
- package/dist/utils/node_modules/svelte/src/internal/client/loop.js +48 -0
- package/dist/utils/node_modules/svelte/src/internal/client/proxy.js +432 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/async.js +302 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/batch.js +988 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/deriveds.js +394 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/effects.js +717 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/equality.js +31 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/props.js +430 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/sources.js +368 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/status.js +25 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/store.js +203 -0
- package/dist/utils/node_modules/svelte/src/internal/client/reactivity/utils.js +40 -0
- package/dist/utils/node_modules/svelte/src/internal/client/render.js +319 -0
- package/dist/utils/node_modules/svelte/src/internal/client/runtime.js +831 -0
- package/dist/utils/node_modules/svelte/src/internal/client/timing.js +16 -0
- package/dist/utils/node_modules/svelte/src/internal/client/validate.js +88 -0
- package/dist/utils/node_modules/svelte/src/internal/client/warnings.js +271 -0
- package/dist/utils/node_modules/svelte/src/internal/disclose-version.js +6 -0
- package/dist/utils/node_modules/svelte/src/internal/flags/async.js +3 -0
- package/dist/utils/node_modules/svelte/src/internal/flags/index.js +23 -0
- package/dist/utils/node_modules/svelte/src/internal/flags/legacy.js +3 -0
- package/dist/utils/node_modules/svelte/src/internal/flags/tracing.js +3 -0
- package/dist/utils/node_modules/svelte/src/internal/index.js +5 -0
- package/dist/utils/node_modules/svelte/src/internal/server/abort-signal.js +13 -0
- package/dist/utils/node_modules/svelte/src/internal/server/blocks/html.js +11 -0
- package/dist/utils/node_modules/svelte/src/internal/server/blocks/snippet.js +24 -0
- package/dist/utils/node_modules/svelte/src/internal/server/context.js +122 -0
- package/dist/utils/node_modules/svelte/src/internal/server/crypto.js +41 -0
- package/dist/utils/node_modules/svelte/src/internal/server/dev.js +115 -0
- package/dist/utils/node_modules/svelte/src/internal/server/errors.js +118 -0
- package/dist/utils/node_modules/svelte/src/internal/server/hydratable.js +142 -0
- package/dist/utils/node_modules/svelte/src/internal/server/hydration.js +6 -0
- package/dist/utils/node_modules/svelte/src/internal/server/index.js +490 -0
- package/dist/utils/node_modules/svelte/src/internal/server/render-context.js +86 -0
- package/dist/utils/node_modules/svelte/src/internal/server/renderer.js +770 -0
- package/dist/utils/node_modules/svelte/src/internal/server/warnings.js +29 -0
- package/dist/utils/node_modules/svelte/src/internal/shared/attributes.js +223 -0
- package/dist/utils/node_modules/svelte/src/internal/shared/clone.js +137 -0
- package/dist/utils/node_modules/svelte/src/internal/shared/dev.js +65 -0
- package/dist/utils/node_modules/svelte/src/internal/shared/errors.js +134 -0
- package/dist/utils/node_modules/svelte/src/internal/shared/utils.js +118 -0
- package/dist/utils/node_modules/svelte/src/internal/shared/validate.js +47 -0
- package/dist/utils/node_modules/svelte/src/internal/shared/warnings.js +40 -0
- package/dist/utils/node_modules/svelte/src/legacy/legacy-client.js +280 -0
- package/dist/utils/node_modules/svelte/src/legacy/legacy-server.js +112 -0
- package/dist/utils/node_modules/svelte/src/motion/index.js +32 -0
- package/dist/utils/node_modules/svelte/src/motion/spring.js +369 -0
- package/dist/utils/node_modules/svelte/src/motion/tweened.js +306 -0
- package/dist/utils/node_modules/svelte/src/motion/utils.js +7 -0
- package/dist/utils/node_modules/svelte/src/reactivity/create-subscriber.js +95 -0
- package/dist/utils/node_modules/svelte/src/reactivity/date.js +118 -0
- package/dist/utils/node_modules/svelte/src/reactivity/index-client.js +7 -0
- package/dist/utils/node_modules/svelte/src/reactivity/index-server.js +23 -0
- package/dist/utils/node_modules/svelte/src/reactivity/map.js +273 -0
- package/dist/utils/node_modules/svelte/src/reactivity/media-query.js +55 -0
- package/dist/utils/node_modules/svelte/src/reactivity/reactive-value.js +24 -0
- package/dist/utils/node_modules/svelte/src/reactivity/set.js +213 -0
- package/dist/utils/node_modules/svelte/src/reactivity/url-search-params.js +174 -0
- package/dist/utils/node_modules/svelte/src/reactivity/url.js +205 -0
- package/dist/utils/node_modules/svelte/src/reactivity/window/index.js +161 -0
- package/dist/utils/node_modules/svelte/src/server/index.js +1 -0
- package/dist/utils/node_modules/svelte/src/store/index-client.js +169 -0
- package/dist/utils/node_modules/svelte/src/store/index-server.js +101 -0
- package/dist/utils/node_modules/svelte/src/store/shared/index.js +209 -0
- package/dist/utils/node_modules/svelte/src/store/utils.js +36 -0
- package/dist/utils/node_modules/svelte/src/transition/index.js +300 -0
- package/dist/utils/node_modules/svelte/src/utils.js +491 -0
- package/dist/utils/node_modules/svelte/src/version.js +8 -0
- package/dist/utils/node_modules/typescript/LICENSE.txt +55 -0
- package/dist/utils/node_modules/typescript/README.md +50 -0
- package/dist/utils/node_modules/typescript/SECURITY.md +41 -0
- package/dist/utils/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/dist/utils/node_modules/typescript/bin/tsc +2 -0
- package/dist/utils/node_modules/typescript/bin/tsserver +2 -0
- package/dist/utils/node_modules/typescript/lib/_tsc.js +133818 -0
- package/dist/utils/node_modules/typescript/lib/_tsserver.js +659 -0
- package/dist/utils/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/dist/utils/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/tsc.js +8 -0
- package/dist/utils/node_modules/typescript/lib/tsserver.js +8 -0
- package/dist/utils/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/dist/utils/node_modules/typescript/lib/typesMap.json +497 -0
- package/dist/utils/node_modules/typescript/lib/typescript.js +200276 -0
- package/dist/utils/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/dist/utils/node_modules/typescript/lib/watchGuard.js +53 -0
- package/dist/utils/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- package/dist/utils/node_modules/typescript/package.json +120 -0
- package/dist/utils/package.json +27 -0
- package/dist/utils/transitions.js +31 -0
- package/package.json +8 -2
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/** @import { Comment, Program } from 'estree' */
|
|
2
|
+
/** @import { AST } from '#compiler' */
|
|
3
|
+
import * as acorn from 'acorn';
|
|
4
|
+
import { walk } from 'zimmerframe';
|
|
5
|
+
import { tsPlugin } from '@sveltejs/acorn-typescript';
|
|
6
|
+
|
|
7
|
+
const ParserWithTS = acorn.Parser.extend(tsPlugin());
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Comment & {
|
|
11
|
+
* start: number;
|
|
12
|
+
* end: number;
|
|
13
|
+
* }} CommentWithLocation
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param {string} source
|
|
18
|
+
* @param {AST.JSComment[]} comments
|
|
19
|
+
* @param {boolean} typescript
|
|
20
|
+
* @param {boolean} [is_script]
|
|
21
|
+
*/
|
|
22
|
+
export function parse(source, comments, typescript, is_script) {
|
|
23
|
+
const parser = typescript ? ParserWithTS : acorn.Parser;
|
|
24
|
+
|
|
25
|
+
const { onComment, add_comments } = get_comment_handlers(
|
|
26
|
+
source,
|
|
27
|
+
/** @type {CommentWithLocation[]} */ (comments)
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
const parse_statement = parser.prototype.parseStatement;
|
|
32
|
+
|
|
33
|
+
// If we're dealing with a <script> then it might contain an export
|
|
34
|
+
// for something that doesn't exist directly inside but is inside the
|
|
35
|
+
// component instead, so we need to ensure that Acorn doesn't throw
|
|
36
|
+
// an error in these cases
|
|
37
|
+
if (is_script) {
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
parser.prototype.parseStatement = function (...args) {
|
|
40
|
+
const v = parse_statement.call(this, ...args);
|
|
41
|
+
// @ts-ignore
|
|
42
|
+
this.undefinedExports = {};
|
|
43
|
+
return v;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
let ast;
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
ast = parser.parse(source, {
|
|
51
|
+
onComment,
|
|
52
|
+
sourceType: 'module',
|
|
53
|
+
ecmaVersion: 16,
|
|
54
|
+
locations: true
|
|
55
|
+
});
|
|
56
|
+
} finally {
|
|
57
|
+
if (is_script) {
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
parser.prototype.parseStatement = parse_statement;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
add_comments(ast);
|
|
64
|
+
|
|
65
|
+
return /** @type {Program} */ (ast);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @param {string} source
|
|
70
|
+
* @param {Comment[]} comments
|
|
71
|
+
* @param {boolean} typescript
|
|
72
|
+
* @param {number} index
|
|
73
|
+
* @returns {acorn.Expression & { leadingComments?: CommentWithLocation[]; trailingComments?: CommentWithLocation[]; }}
|
|
74
|
+
*/
|
|
75
|
+
export function parse_expression_at(source, comments, typescript, index) {
|
|
76
|
+
const parser = typescript ? ParserWithTS : acorn.Parser;
|
|
77
|
+
|
|
78
|
+
const { onComment, add_comments } = get_comment_handlers(
|
|
79
|
+
source,
|
|
80
|
+
/** @type {CommentWithLocation[]} */ (comments),
|
|
81
|
+
index
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const ast = parser.parseExpressionAt(source, index, {
|
|
85
|
+
onComment,
|
|
86
|
+
sourceType: 'module',
|
|
87
|
+
ecmaVersion: 16,
|
|
88
|
+
locations: true
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
add_comments(ast);
|
|
92
|
+
|
|
93
|
+
return ast;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Acorn doesn't add comments to the AST by itself. This factory returns the capabilities
|
|
98
|
+
* to add them after the fact. They are needed in order to support `svelte-ignore` comments
|
|
99
|
+
* in JS code and so that `prettier-plugin-svelte` doesn't remove all comments when formatting.
|
|
100
|
+
* @param {string} source
|
|
101
|
+
* @param {CommentWithLocation[]} comments
|
|
102
|
+
* @param {number} index
|
|
103
|
+
*/
|
|
104
|
+
function get_comment_handlers(source, comments, index = 0) {
|
|
105
|
+
return {
|
|
106
|
+
/**
|
|
107
|
+
* @param {boolean} block
|
|
108
|
+
* @param {string} value
|
|
109
|
+
* @param {number} start
|
|
110
|
+
* @param {number} end
|
|
111
|
+
* @param {import('acorn').Position} [start_loc]
|
|
112
|
+
* @param {import('acorn').Position} [end_loc]
|
|
113
|
+
*/
|
|
114
|
+
onComment: (block, value, start, end, start_loc, end_loc) => {
|
|
115
|
+
if (block && /\n/.test(value)) {
|
|
116
|
+
let a = start;
|
|
117
|
+
while (a > 0 && source[a - 1] !== '\n') a -= 1;
|
|
118
|
+
|
|
119
|
+
let b = a;
|
|
120
|
+
while (/[ \t]/.test(source[b])) b += 1;
|
|
121
|
+
|
|
122
|
+
const indentation = source.slice(a, b);
|
|
123
|
+
value = value.replace(new RegExp(`^${indentation}`, 'gm'), '');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
comments.push({
|
|
127
|
+
type: block ? 'Block' : 'Line',
|
|
128
|
+
value,
|
|
129
|
+
start,
|
|
130
|
+
end,
|
|
131
|
+
loc: {
|
|
132
|
+
start: /** @type {import('acorn').Position} */ (start_loc),
|
|
133
|
+
end: /** @type {import('acorn').Position} */ (end_loc)
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
/** @param {acorn.Node & { leadingComments?: CommentWithLocation[]; trailingComments?: CommentWithLocation[]; }} ast */
|
|
139
|
+
add_comments(ast) {
|
|
140
|
+
if (comments.length === 0) return;
|
|
141
|
+
|
|
142
|
+
comments = comments
|
|
143
|
+
.filter((comment) => comment.start >= index)
|
|
144
|
+
.map(({ type, value, start, end }) => ({ type, value, start, end }));
|
|
145
|
+
|
|
146
|
+
walk(ast, null, {
|
|
147
|
+
_(node, { next, path }) {
|
|
148
|
+
let comment;
|
|
149
|
+
|
|
150
|
+
while (comments[0] && comments[0].start < node.start) {
|
|
151
|
+
comment = /** @type {CommentWithLocation} */ (comments.shift());
|
|
152
|
+
(node.leadingComments ||= []).push(comment);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
next();
|
|
156
|
+
|
|
157
|
+
if (comments[0]) {
|
|
158
|
+
const parent = /** @type {any} */ (path.at(-1));
|
|
159
|
+
|
|
160
|
+
if (parent === undefined || node.end !== parent.end) {
|
|
161
|
+
const slice = source.slice(node.end, comments[0].start);
|
|
162
|
+
const is_last_in_body =
|
|
163
|
+
((parent?.type === 'BlockStatement' || parent?.type === 'Program') &&
|
|
164
|
+
parent.body.indexOf(node) === parent.body.length - 1) ||
|
|
165
|
+
(parent?.type === 'ArrayExpression' &&
|
|
166
|
+
parent.elements.indexOf(node) === parent.elements.length - 1) ||
|
|
167
|
+
(parent?.type === 'ObjectExpression' &&
|
|
168
|
+
parent.properties.indexOf(node) === parent.properties.length - 1);
|
|
169
|
+
|
|
170
|
+
if (is_last_in_body) {
|
|
171
|
+
// Special case: There can be multiple trailing comments after the last node in a block,
|
|
172
|
+
// and they can be separated by newlines
|
|
173
|
+
let end = node.end;
|
|
174
|
+
|
|
175
|
+
while (comments.length) {
|
|
176
|
+
const comment = comments[0];
|
|
177
|
+
if (parent && comment.start >= parent.end) break;
|
|
178
|
+
|
|
179
|
+
(node.trailingComments ||= []).push(comment);
|
|
180
|
+
comments.shift();
|
|
181
|
+
end = comment.end;
|
|
182
|
+
}
|
|
183
|
+
} else if (node.end <= comments[0].start && /^[,) \t]*$/.test(slice)) {
|
|
184
|
+
node.trailingComments = [/** @type {CommentWithLocation} */ (comments.shift())];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// Special case: Trailing comments after the root node (which can only happen for expression tags or for Program nodes).
|
|
192
|
+
// Adding them ensures that we can later detect the end of the expression tag correctly.
|
|
193
|
+
if (comments.length > 0 && (comments[0].start >= ast.end || ast.type === 'Program')) {
|
|
194
|
+
(ast.trailingComments ||= []).push(...comments.splice(0));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/** @import { AST } from '#compiler' */
|
|
2
|
+
/** @import { Location } from 'locate-character' */
|
|
3
|
+
/** @import * as ESTree from 'estree' */
|
|
4
|
+
// @ts-expect-error acorn type definitions are borked in the release we use
|
|
5
|
+
import { isIdentifierStart, isIdentifierChar } from 'acorn';
|
|
6
|
+
import fragment from './state/fragment.js';
|
|
7
|
+
import { regex_whitespace } from '../patterns.js';
|
|
8
|
+
import * as e from '../../errors.js';
|
|
9
|
+
import { create_fragment } from './utils/create.js';
|
|
10
|
+
import read_options from './read/options.js';
|
|
11
|
+
import { is_reserved } from '../../../utils.js';
|
|
12
|
+
import { disallow_children } from '../2-analyze/visitors/shared/special-element.js';
|
|
13
|
+
import * as state from '../../state.js';
|
|
14
|
+
|
|
15
|
+
const regex_position_indicator = / \(\d+:\d+\)$/;
|
|
16
|
+
|
|
17
|
+
const regex_lang_attribute =
|
|
18
|
+
/<!--[^]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/g;
|
|
19
|
+
|
|
20
|
+
export class Parser {
|
|
21
|
+
/**
|
|
22
|
+
* @readonly
|
|
23
|
+
* @type {string}
|
|
24
|
+
*/
|
|
25
|
+
template;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Whether or not we're in loose parsing mode, in which
|
|
29
|
+
* case we try to continue parsing as much as possible
|
|
30
|
+
* @type {boolean}
|
|
31
|
+
*/
|
|
32
|
+
loose;
|
|
33
|
+
|
|
34
|
+
/** */
|
|
35
|
+
index = 0;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Creates a minimal parser instance for CSS-only parsing.
|
|
39
|
+
* Skips Svelte component parsing setup.
|
|
40
|
+
* @param {string} source
|
|
41
|
+
* @returns {Parser}
|
|
42
|
+
*/
|
|
43
|
+
static forCss(source) {
|
|
44
|
+
const parser = Object.create(Parser.prototype);
|
|
45
|
+
parser.template = source;
|
|
46
|
+
parser.index = 0;
|
|
47
|
+
parser.loose = false;
|
|
48
|
+
return parser;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Whether we're parsing in TypeScript mode */
|
|
52
|
+
ts = false;
|
|
53
|
+
|
|
54
|
+
/** @type {AST.TemplateNode[]} */
|
|
55
|
+
stack = [];
|
|
56
|
+
|
|
57
|
+
/** @type {AST.Fragment[]} */
|
|
58
|
+
fragments = [];
|
|
59
|
+
|
|
60
|
+
/** @type {AST.Root} */
|
|
61
|
+
root;
|
|
62
|
+
|
|
63
|
+
/** @type {Record<string, boolean>} */
|
|
64
|
+
meta_tags = {};
|
|
65
|
+
|
|
66
|
+
/** @type {LastAutoClosedTag | undefined} */
|
|
67
|
+
last_auto_closed_tag;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @param {string} template
|
|
71
|
+
* @param {boolean} loose
|
|
72
|
+
*/
|
|
73
|
+
constructor(template, loose) {
|
|
74
|
+
if (typeof template !== 'string') {
|
|
75
|
+
throw new TypeError('Template must be a string');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
this.loose = loose;
|
|
79
|
+
this.template = template.trimEnd();
|
|
80
|
+
|
|
81
|
+
let match_lang;
|
|
82
|
+
|
|
83
|
+
do match_lang = regex_lang_attribute.exec(template);
|
|
84
|
+
while (match_lang && match_lang[0][1] !== 's'); // ensure it starts with '<s' to match script tags
|
|
85
|
+
|
|
86
|
+
regex_lang_attribute.lastIndex = 0; // reset matched index to pass tests - otherwise declare the regex inside the constructor
|
|
87
|
+
|
|
88
|
+
this.ts = match_lang?.[2] === 'ts';
|
|
89
|
+
|
|
90
|
+
this.root = {
|
|
91
|
+
css: null,
|
|
92
|
+
js: [],
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
start: null,
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
end: null,
|
|
97
|
+
type: 'Root',
|
|
98
|
+
fragment: create_fragment(),
|
|
99
|
+
options: null,
|
|
100
|
+
comments: [],
|
|
101
|
+
metadata: {
|
|
102
|
+
ts: this.ts
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
this.stack.push(this.root);
|
|
107
|
+
this.fragments.push(this.root.fragment);
|
|
108
|
+
|
|
109
|
+
/** @type {ParserState} */
|
|
110
|
+
let state = fragment;
|
|
111
|
+
|
|
112
|
+
while (this.index < this.template.length) {
|
|
113
|
+
state = state(this) || fragment;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (this.stack.length > 1) {
|
|
117
|
+
const current = this.current();
|
|
118
|
+
|
|
119
|
+
if (this.loose) {
|
|
120
|
+
current.end = this.template.length;
|
|
121
|
+
} else if (current.type === 'RegularElement') {
|
|
122
|
+
current.end = current.start + 1;
|
|
123
|
+
e.element_unclosed(current, current.name);
|
|
124
|
+
} else {
|
|
125
|
+
current.end = current.start + 1;
|
|
126
|
+
e.block_unclosed(current);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (state !== fragment) {
|
|
131
|
+
e.unexpected_eof(this.index);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
this.root.start = 0;
|
|
135
|
+
this.root.end = template.length;
|
|
136
|
+
|
|
137
|
+
const options_index = this.root.fragment.nodes.findIndex(
|
|
138
|
+
/** @param {any} thing */
|
|
139
|
+
(thing) => thing.type === 'SvelteOptions'
|
|
140
|
+
);
|
|
141
|
+
if (options_index !== -1) {
|
|
142
|
+
const options = /** @type {AST.SvelteOptionsRaw} */ (this.root.fragment.nodes[options_index]);
|
|
143
|
+
this.root.fragment.nodes.splice(options_index, 1);
|
|
144
|
+
this.root.options = read_options(options);
|
|
145
|
+
|
|
146
|
+
disallow_children(options);
|
|
147
|
+
|
|
148
|
+
// We need this for the old AST format
|
|
149
|
+
Object.defineProperty(this.root.options, '__raw__', {
|
|
150
|
+
value: options,
|
|
151
|
+
enumerable: false
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
current() {
|
|
157
|
+
return this.stack[this.stack.length - 1];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @param {any} err
|
|
162
|
+
* @returns {never}
|
|
163
|
+
*/
|
|
164
|
+
acorn_error(err) {
|
|
165
|
+
e.js_parse_error(err.pos, err.message.replace(regex_position_indicator, ''));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @param {string} str
|
|
170
|
+
* @param {boolean} required
|
|
171
|
+
* @param {boolean} required_in_loose
|
|
172
|
+
*/
|
|
173
|
+
eat(str, required = false, required_in_loose = true) {
|
|
174
|
+
if (this.match(str)) {
|
|
175
|
+
this.index += str.length;
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (required && (!this.loose || required_in_loose)) {
|
|
180
|
+
e.expected_token(this.index, str);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** @param {string} str */
|
|
187
|
+
match(str) {
|
|
188
|
+
const length = str.length;
|
|
189
|
+
if (length === 1) {
|
|
190
|
+
// more performant than slicing
|
|
191
|
+
return this.template[this.index] === str;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return this.template.slice(this.index, this.index + length) === str;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Match a regex at the current index
|
|
199
|
+
* @param {RegExp} pattern Should have a ^ anchor at the start so the regex doesn't search past the beginning, resulting in worse performance
|
|
200
|
+
*/
|
|
201
|
+
match_regex(pattern) {
|
|
202
|
+
const match = pattern.exec(this.template.slice(this.index));
|
|
203
|
+
if (!match || match.index !== 0) return null;
|
|
204
|
+
|
|
205
|
+
return match[0];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
allow_whitespace() {
|
|
209
|
+
while (this.index < this.template.length && regex_whitespace.test(this.template[this.index])) {
|
|
210
|
+
this.index++;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Search for a regex starting at the current index and return the result if it matches
|
|
216
|
+
* @param {RegExp} pattern Should have a ^ anchor at the start so the regex doesn't search past the beginning, resulting in worse performance
|
|
217
|
+
*/
|
|
218
|
+
read(pattern) {
|
|
219
|
+
const result = this.match_regex(pattern);
|
|
220
|
+
if (result) this.index += result.length;
|
|
221
|
+
return result;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @returns {ESTree.Identifier & { start: number, end: number, loc: { start: Location, end: Location } }}
|
|
226
|
+
*/
|
|
227
|
+
read_identifier() {
|
|
228
|
+
const start = this.index;
|
|
229
|
+
let end = start;
|
|
230
|
+
let name = '';
|
|
231
|
+
|
|
232
|
+
const code = /** @type {number} */ (this.template.codePointAt(this.index));
|
|
233
|
+
|
|
234
|
+
if (isIdentifierStart(code, true)) {
|
|
235
|
+
let i = this.index;
|
|
236
|
+
end += code <= 0xffff ? 1 : 2;
|
|
237
|
+
|
|
238
|
+
while (end < this.template.length) {
|
|
239
|
+
const code = /** @type {number} */ (this.template.codePointAt(end));
|
|
240
|
+
|
|
241
|
+
if (!isIdentifierChar(code, true)) break;
|
|
242
|
+
end += code <= 0xffff ? 1 : 2;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
name = this.template.slice(start, end);
|
|
246
|
+
this.index = end;
|
|
247
|
+
|
|
248
|
+
if (is_reserved(name)) {
|
|
249
|
+
e.unexpected_reserved_word(start, name);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
type: 'Identifier',
|
|
255
|
+
name,
|
|
256
|
+
start,
|
|
257
|
+
end,
|
|
258
|
+
loc: {
|
|
259
|
+
start: state.locator(start),
|
|
260
|
+
end: state.locator(end)
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/** @param {RegExp} pattern */
|
|
266
|
+
read_until(pattern) {
|
|
267
|
+
if (this.index >= this.template.length) {
|
|
268
|
+
if (this.loose) return '';
|
|
269
|
+
e.unexpected_eof(this.template.length);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const start = this.index;
|
|
273
|
+
const match = pattern.exec(this.template.slice(start));
|
|
274
|
+
|
|
275
|
+
if (match) {
|
|
276
|
+
this.index = start + match.index;
|
|
277
|
+
return this.template.slice(start, this.index);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
this.index = this.template.length;
|
|
281
|
+
return this.template.slice(start);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
require_whitespace() {
|
|
285
|
+
if (!regex_whitespace.test(this.template[this.index])) {
|
|
286
|
+
e.expected_whitespace(this.index);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
this.allow_whitespace();
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
pop() {
|
|
293
|
+
this.fragments.pop();
|
|
294
|
+
return this.stack.pop();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @template {AST.Fragment['nodes'][number]} T
|
|
299
|
+
* @param {T} node
|
|
300
|
+
* @returns {T}
|
|
301
|
+
*/
|
|
302
|
+
append(node) {
|
|
303
|
+
this.fragments.at(-1)?.nodes.push(node);
|
|
304
|
+
return node;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @param {string} template
|
|
310
|
+
* @param {boolean} [loose]
|
|
311
|
+
* @returns {AST.Root}
|
|
312
|
+
*/
|
|
313
|
+
export function parse(template, loose = false) {
|
|
314
|
+
state.set_source(template);
|
|
315
|
+
|
|
316
|
+
const parser = new Parser(template, loose);
|
|
317
|
+
return parser.root;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/** @typedef {(parser: Parser) => ParserState | void} ParserState */
|
|
321
|
+
|
|
322
|
+
/** @typedef {Object} LastAutoClosedTag
|
|
323
|
+
* @property {string} tag
|
|
324
|
+
* @property {string} reason
|
|
325
|
+
* @property {number} depth
|
|
326
|
+
*/
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/** @import { Pattern } from 'estree' */
|
|
2
|
+
/** @import { Parser } from '../index.js' */
|
|
3
|
+
import { match_bracket } from '../utils/bracket.js';
|
|
4
|
+
import { parse_expression_at } from '../acorn.js';
|
|
5
|
+
import { regex_not_newline_characters } from '../../patterns.js';
|
|
6
|
+
import * as e from '../../../errors.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {Parser} parser
|
|
10
|
+
* @returns {Pattern}
|
|
11
|
+
*/
|
|
12
|
+
export default function read_pattern(parser) {
|
|
13
|
+
const start = parser.index;
|
|
14
|
+
let i = parser.index;
|
|
15
|
+
|
|
16
|
+
const id = parser.read_identifier();
|
|
17
|
+
|
|
18
|
+
if (id.name !== '') {
|
|
19
|
+
const annotation = read_type_annotation(parser);
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
...id,
|
|
23
|
+
typeAnnotation: annotation
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const char = parser.template[i];
|
|
28
|
+
|
|
29
|
+
if (char !== '{' && char !== '[') {
|
|
30
|
+
e.expected_pattern(i);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
i = match_bracket(parser, start);
|
|
34
|
+
parser.index = i;
|
|
35
|
+
|
|
36
|
+
const pattern_string = parser.template.slice(start, i);
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
// the length of the `space_with_newline` has to be start - 1
|
|
40
|
+
// because we added a `(` in front of the pattern_string,
|
|
41
|
+
// which shifted the entire string to right by 1
|
|
42
|
+
// so we offset it by removing 1 character in the `space_with_newline`
|
|
43
|
+
// to achieve that, we remove the 1st space encountered,
|
|
44
|
+
// so it will not affect the `column` of the node
|
|
45
|
+
let space_with_newline = parser.template
|
|
46
|
+
.slice(0, start)
|
|
47
|
+
.replace(regex_not_newline_characters, ' ');
|
|
48
|
+
const first_space = space_with_newline.indexOf(' ');
|
|
49
|
+
space_with_newline =
|
|
50
|
+
space_with_newline.slice(0, first_space) + space_with_newline.slice(first_space + 1);
|
|
51
|
+
|
|
52
|
+
const expression = /** @type {any} */ (
|
|
53
|
+
parse_expression_at(
|
|
54
|
+
`${space_with_newline}(${pattern_string} = 1)`,
|
|
55
|
+
parser.root.comments,
|
|
56
|
+
parser.ts,
|
|
57
|
+
start - 1
|
|
58
|
+
)
|
|
59
|
+
).left;
|
|
60
|
+
|
|
61
|
+
expression.typeAnnotation = read_type_annotation(parser);
|
|
62
|
+
if (expression.typeAnnotation) {
|
|
63
|
+
expression.end = expression.typeAnnotation.end;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return expression;
|
|
67
|
+
} catch (error) {
|
|
68
|
+
parser.acorn_error(error);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @param {Parser} parser
|
|
74
|
+
* @returns {any}
|
|
75
|
+
*/
|
|
76
|
+
function read_type_annotation(parser) {
|
|
77
|
+
const start = parser.index;
|
|
78
|
+
parser.allow_whitespace();
|
|
79
|
+
|
|
80
|
+
if (!parser.eat(':')) {
|
|
81
|
+
parser.index = start;
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// we need to trick Acorn into parsing the type annotation
|
|
86
|
+
const insert = '_ as ';
|
|
87
|
+
let a = parser.index - insert.length;
|
|
88
|
+
const template =
|
|
89
|
+
parser.template.slice(0, a).replace(/[^\n]/g, ' ') +
|
|
90
|
+
insert +
|
|
91
|
+
// If this is a type annotation for a function parameter, Acorn-TS will treat subsequent
|
|
92
|
+
// parameters as part of a sequence expression instead, and will then error on optional
|
|
93
|
+
// parameters (`?:`). Therefore replace that sequence with something that will not error.
|
|
94
|
+
parser.template.slice(parser.index).replace(/\?\s*:/g, ':');
|
|
95
|
+
let expression = parse_expression_at(template, parser.root.comments, parser.ts, a);
|
|
96
|
+
|
|
97
|
+
// `foo: bar = baz` gets mangled — fix it
|
|
98
|
+
if (expression.type === 'AssignmentExpression') {
|
|
99
|
+
let b = expression.right.start;
|
|
100
|
+
while (template[b] !== '=') b -= 1;
|
|
101
|
+
expression = parse_expression_at(template.slice(0, b), parser.root.comments, parser.ts, a);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// `array as item: string, index` becomes `string, index`, which is mistaken as a sequence expression - fix that
|
|
105
|
+
if (expression.type === 'SequenceExpression') {
|
|
106
|
+
expression = expression.expressions[0];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
parser.index = /** @type {number} */ (expression.end);
|
|
110
|
+
return {
|
|
111
|
+
type: 'TSTypeAnnotation',
|
|
112
|
+
start,
|
|
113
|
+
end: parser.index,
|
|
114
|
+
typeAnnotation: /** @type {any} */ (expression).typeAnnotation
|
|
115
|
+
};
|
|
116
|
+
}
|