@dcloudio/vue-cli-plugin-uni 2.0.0 → 2.0.1-32920211122002
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/commands/build.js +64 -33
- package/commands/serve.js +12 -17
- package/generator.js +6 -2
- package/index.js +5 -3
- package/lib/chain-webpack.js +8 -1
- package/lib/check-update.js +56 -0
- package/lib/commands/custom.js +7 -4
- package/lib/commands/invoke.js +5 -4
- package/lib/configure-webpack.js +35 -5
- package/lib/copy-webpack-options.js +60 -20
- package/lib/env.js +99 -51
- package/lib/error-reporting.js +9 -3
- package/lib/mp/index.js +31 -16
- package/lib/options.js +6 -3
- package/lib/util.js +5 -6
- package/package.json +3 -3
- package/packages/@vue/component-compiler-utils/MODIFY.md +5 -0
- package/packages/@vue/component-compiler-utils/dist/compileStyle.js +11 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/API.md +873 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/CHANGELOG.md +466 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/LICENSE-MIT +22 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/README.md +49 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/index.js +26 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/parser.js +1088 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/processor.js +185 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/attribute.js +468 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/className.js +67 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/combinator.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/comment.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/constructors.js +91 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/container.js +392 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/guards.js +54 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/id.js +39 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/index.js +39 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/namespace.js +98 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/nesting.js +36 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/node.js +216 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/pseudo.js +40 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/root.js +60 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/selector.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/string.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/tag.js +35 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/types.js +15 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/selectors/universal.js +36 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/sortAscending.js +10 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenTypes.js +39 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/tokenize.js +271 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/ensureObject.js +20 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/getProp.js +22 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/index.js +41 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/stripComments.js +21 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/dist/util/unesc.js +18 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/package.json +76 -0
- package/packages/@vue/component-compiler-utils/node_modules/postcss-selector-parser/postcss-selector-parser.d.ts +499 -0
- package/packages/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
- package/packages/@vue/devtools-api/lib/cjs/api/api.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
- package/packages/@vue/devtools-api/lib/cjs/api/app.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
- package/packages/@vue/devtools-api/lib/cjs/api/component.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
- package/packages/@vue/devtools-api/lib/cjs/api/context.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
- package/packages/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
- package/packages/@vue/devtools-api/lib/cjs/api/index.js +18 -0
- package/packages/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
- package/packages/@vue/devtools-api/lib/cjs/api/util.js +2 -0
- package/packages/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
- package/packages/@vue/devtools-api/lib/cjs/const.js +4 -0
- package/packages/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
- package/packages/@vue/devtools-api/lib/cjs/env.js +16 -0
- package/packages/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
- package/packages/@vue/devtools-api/lib/cjs/index.js +31 -0
- package/packages/@vue/devtools-api/lib/esm/api/api.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/app.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/component.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/context.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/api/index.js +6 -0
- package/packages/@vue/devtools-api/lib/esm/api/util.js +0 -0
- package/packages/@vue/devtools-api/lib/esm/const.js +1 -0
- package/packages/@vue/devtools-api/lib/esm/env.js +11 -0
- package/packages/@vue/devtools-api/lib/esm/index.js +17 -0
- package/packages/@vue/devtools-api/package.json +38 -0
- package/packages/app-vue-style-loader/lib/addStylesClient.js +1 -1
- package/packages/h5-vue-style-loader/lib/addStylesClient.js +1 -1
- package/packages/mp-vue/dist/mp.runtime.esm.js +3 -2
- package/packages/mp-vue/package.json +1 -0
- package/packages/uni-app/LICENSE +202 -0
- package/packages/uni-app/dist/uni-app.cjs.js +165 -0
- package/packages/uni-app/dist/uni-app.d.ts +61 -0
- package/packages/uni-app/dist/uni-app.es.js +108 -0
- package/packages/uni-app/package.json +22 -0
- package/packages/uni-cloud/dist/index.js +1 -1
- package/packages/uni-stat/dist/uni-stat.cjs.js +961 -0
- package/packages/uni-stat/dist/uni-stat.es.js +959 -0
- package/packages/uni-stat/lib/uni.plugin.js +68 -0
- package/packages/uni-stat/package.json +25 -0
- package/packages/vue3/node_modules/.yarn-integrity +27 -0
- package/packages/vue3/node_modules/@intlify/core-base/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/core-base/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.js +989 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.cjs.prod.js +735 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.d.ts +576 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.js +2771 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.esm-bundler.js +965 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.js +2814 -0
- package/packages/vue3/node_modules/@intlify/core-base/dist/core-base.global.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/core-base/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/core-base/package.json +59 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/README.md +13 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.js +15 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.cjs.prod.js +15 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.d.ts +43 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/dist/devtools-if.esm-bundler.js +11 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/devtools-if/package.json +49 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.js +1400 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.cjs.prod.js +1395 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.d.ts +197 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.js +1348 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js +1329 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.js +1365 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/dist/message-compiler.global.prod.js +6 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/message-compiler/package.json +56 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.js +302 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.cjs.prod.js +302 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.d.ts +21 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/dist/message-resolver.esm-bundler.js +297 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/message-resolver/package.json +46 -0
- package/packages/vue3/node_modules/@intlify/runtime/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/runtime/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.js +116 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.cjs.prod.js +116 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.d.ts +95 -0
- package/packages/vue3/node_modules/@intlify/runtime/dist/runtime.esm-bundler.js +111 -0
- package/packages/vue3/node_modules/@intlify/runtime/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/runtime/package.json +51 -0
- package/packages/vue3/node_modules/@intlify/shared/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/shared/README.md +18 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.js +222 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.cjs.prod.js +209 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.d.ts +145 -0
- package/packages/vue3/node_modules/@intlify/shared/dist/shared.esm-bundler.js +192 -0
- package/packages/vue3/node_modules/@intlify/shared/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/shared/package.json +46 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/LICENSE +20 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/README.md +7 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.js +24 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.cjs.prod.js +24 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.d.ts +81 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/dist/vue-devtools.esm-bundler.js +18 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/index.js +7 -0
- package/packages/vue3/node_modules/@intlify/vue-devtools/package.json +51 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.d.ts +90 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/api.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.d.ts +1 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/app.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.d.ts +76 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/component.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.d.ts +5 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/context.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.d.ts +169 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.d.ts +6 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/index.js +18 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.d.ts +4 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/api/util.js +2 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.d.ts +1 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/const.js +4 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.d.ts +10 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/env.js +16 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.d.ts +14 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/cjs/index.js +31 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/api.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/app.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/component.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/context.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/hooks.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/index.js +6 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/api/util.js +0 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/const.js +1 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/env.js +11 -0
- package/packages/vue3/node_modules/@vue/devtools-api/lib/esm/index.js +17 -0
- package/packages/vue3/node_modules/@vue/devtools-api/package.json +38 -0
- package/packages/vue3/node_modules/source-map/CHANGELOG.md +301 -0
- package/packages/vue3/node_modules/source-map/LICENSE +28 -0
- package/packages/vue3/node_modules/source-map/README.md +742 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.debug.js +3234 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.js +3233 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.min.js +2 -0
- package/packages/vue3/node_modules/source-map/dist/source-map.min.js.map +1 -0
- package/packages/vue3/node_modules/source-map/lib/array-set.js +121 -0
- package/packages/vue3/node_modules/source-map/lib/base64-vlq.js +140 -0
- package/packages/vue3/node_modules/source-map/lib/base64.js +67 -0
- package/packages/vue3/node_modules/source-map/lib/binary-search.js +111 -0
- package/packages/vue3/node_modules/source-map/lib/mapping-list.js +79 -0
- package/packages/vue3/node_modules/source-map/lib/quick-sort.js +114 -0
- package/packages/vue3/node_modules/source-map/lib/source-map-consumer.js +1145 -0
- package/packages/vue3/node_modules/source-map/lib/source-map-generator.js +425 -0
- package/packages/vue3/node_modules/source-map/lib/source-node.js +413 -0
- package/packages/vue3/node_modules/source-map/lib/util.js +488 -0
- package/packages/vue3/node_modules/source-map/package.json +73 -0
- package/packages/vue3/node_modules/source-map/source-map.d.ts +98 -0
- package/packages/vue3/node_modules/source-map/source-map.js +8 -0
- package/packages/vue3/node_modules/vue-i18n/LICENSE +20 -0
- package/packages/vue3/node_modules/vue-i18n/README.md +74 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.js +1801 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.cjs.prod.js +1685 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.d.ts +3302 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.js +5052 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js +2226 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.js +5065 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.global.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.js +3724 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-browser.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.esm-bundler.js +2224 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.js +3737 -0
- package/packages/vue3/node_modules/vue-i18n/dist/vue-i18n.runtime.global.prod.js +6 -0
- package/packages/vue3/node_modules/vue-i18n/index.js +7 -0
- package/packages/vue3/node_modules/vue-i18n/package.json +69 -0
- package/packages/vue3/node_modules/vue-i18n/vetur/attributes.json +62 -0
- package/packages/vue3/node_modules/vue-i18n/vetur/tags.json +14 -0
- package/packages/vue3/package.json +15 -0
- package/packages/vue3/yarn.lock +79 -0
- package/packages/vuex/CHANGELOG.md +604 -0
- package/packages/vuex/LICENSE +21 -0
- package/packages/vuex/README.md +55 -0
- package/packages/vuex/dist/vuex.cjs.js +1474 -0
- package/packages/vuex/dist/vuex.esm-browser.js +1472 -0
- package/packages/vuex/dist/vuex.esm-browser.prod.js +1307 -0
- package/packages/vuex/dist/vuex.esm-bundler.js +1473 -0
- package/packages/vuex/dist/vuex.global.js +1499 -0
- package/packages/vuex/dist/vuex.global.prod.js +6 -0
- package/packages/vuex/dist/vuex.mjs +32 -0
- package/packages/vuex/package.json +99 -0
- package/packages/vuex/types/helpers.d.ts +86 -0
- package/packages/vuex/types/index.d.ts +167 -0
- package/packages/vuex/types/logger.d.ts +20 -0
- package/packages/vuex/types/vue.d.ts +12 -0
- package/packages/vuex3/CHANGELOG.md +356 -0
- package/packages/vuex3/LICENSE +21 -0
- package/packages/vuex3/README.md +59 -0
- package/packages/vuex3/dist/logger.js +155 -0
- package/packages/vuex3/dist/vuex.common.js +1244 -0
- package/packages/vuex3/dist/vuex.esm.browser.js +1200 -0
- package/packages/vuex3/dist/vuex.esm.browser.min.js +6 -0
- package/packages/vuex3/dist/vuex.esm.js +1243 -0
- package/packages/vuex3/dist/vuex.js +1250 -0
- package/packages/vuex3/dist/vuex.min.js +6 -0
- package/packages/vuex3/dist/vuex.mjs +26 -0
- package/packages/vuex3/package.json +96 -0
- package/packages/vuex3/types/helpers.d.ts +86 -0
- package/packages/vuex3/types/index.d.ts +164 -0
- package/packages/vuex3/types/logger.d.ts +20 -0
- package/packages/vuex3/types/vue.d.ts +18 -0
- package/packages/webpack-uni-app-loader/plugin/index.js +8 -2
- package/packages/webpack-uni-app-loader/view/main.js +12 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _node = require('./node');
|
|
6
|
+
|
|
7
|
+
var _node2 = _interopRequireDefault(_node);
|
|
8
|
+
|
|
9
|
+
var _types = require('./types');
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
18
|
+
|
|
19
|
+
var ID = function (_Node) {
|
|
20
|
+
_inherits(ID, _Node);
|
|
21
|
+
|
|
22
|
+
function ID(opts) {
|
|
23
|
+
_classCallCheck(this, ID);
|
|
24
|
+
|
|
25
|
+
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
|
|
26
|
+
|
|
27
|
+
_this.type = _types.ID;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
ID.prototype.toString = function toString() {
|
|
32
|
+
return [this.rawSpaceBefore, String('#' + this.stringifyProperty("value")), this.rawSpaceAfter].join('');
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return ID;
|
|
36
|
+
}(_node2.default);
|
|
37
|
+
|
|
38
|
+
exports.default = ID;
|
|
39
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _types = require("./types");
|
|
6
|
+
|
|
7
|
+
Object.keys(_types).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
Object.defineProperty(exports, key, {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function get() {
|
|
12
|
+
return _types[key];
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
var _constructors = require("./constructors");
|
|
18
|
+
|
|
19
|
+
Object.keys(_constructors).forEach(function (key) {
|
|
20
|
+
if (key === "default" || key === "__esModule") return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _constructors[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
var _guards = require("./guards");
|
|
30
|
+
|
|
31
|
+
Object.keys(_guards).forEach(function (key) {
|
|
32
|
+
if (key === "default" || key === "__esModule") return;
|
|
33
|
+
Object.defineProperty(exports, key, {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function get() {
|
|
36
|
+
return _guards[key];
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
6
|
+
|
|
7
|
+
var _cssesc = require('cssesc');
|
|
8
|
+
|
|
9
|
+
var _cssesc2 = _interopRequireDefault(_cssesc);
|
|
10
|
+
|
|
11
|
+
var _util = require('../util');
|
|
12
|
+
|
|
13
|
+
var _node = require('./node');
|
|
14
|
+
|
|
15
|
+
var _node2 = _interopRequireDefault(_node);
|
|
16
|
+
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
|
|
19
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
20
|
+
|
|
21
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
22
|
+
|
|
23
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
24
|
+
|
|
25
|
+
var Namespace = function (_Node) {
|
|
26
|
+
_inherits(Namespace, _Node);
|
|
27
|
+
|
|
28
|
+
function Namespace() {
|
|
29
|
+
_classCallCheck(this, Namespace);
|
|
30
|
+
|
|
31
|
+
return _possibleConstructorReturn(this, _Node.apply(this, arguments));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Namespace.prototype.qualifiedName = function qualifiedName(value) {
|
|
35
|
+
if (this.namespace) {
|
|
36
|
+
return this.namespaceString + '|' + value;
|
|
37
|
+
} else {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
Namespace.prototype.toString = function toString() {
|
|
43
|
+
return [this.rawSpaceBefore, this.qualifiedName(this.stringifyProperty("value")), this.rawSpaceAfter].join('');
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
_createClass(Namespace, [{
|
|
47
|
+
key: 'namespace',
|
|
48
|
+
get: function get() {
|
|
49
|
+
return this._namespace;
|
|
50
|
+
},
|
|
51
|
+
set: function set(namespace) {
|
|
52
|
+
if (namespace === true || namespace === "*" || namespace === "&") {
|
|
53
|
+
this._namespace = namespace;
|
|
54
|
+
if (this.raws) {
|
|
55
|
+
delete this.raws.namespace;
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var escaped = (0, _cssesc2.default)(namespace, { isIdentifier: true });
|
|
61
|
+
this._namespace = namespace;
|
|
62
|
+
if (escaped !== namespace) {
|
|
63
|
+
(0, _util.ensureObject)(this, "raws");
|
|
64
|
+
this.raws.namespace = escaped;
|
|
65
|
+
} else if (this.raws) {
|
|
66
|
+
delete this.raws.namespace;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: 'ns',
|
|
71
|
+
get: function get() {
|
|
72
|
+
return this._namespace;
|
|
73
|
+
},
|
|
74
|
+
set: function set(namespace) {
|
|
75
|
+
this.namespace = namespace;
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
key: 'namespaceString',
|
|
79
|
+
get: function get() {
|
|
80
|
+
if (this.namespace) {
|
|
81
|
+
var ns = this.stringifyProperty("namespace");
|
|
82
|
+
if (ns === true) {
|
|
83
|
+
return '';
|
|
84
|
+
} else {
|
|
85
|
+
return ns;
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}]);
|
|
92
|
+
|
|
93
|
+
return Namespace;
|
|
94
|
+
}(_node2.default);
|
|
95
|
+
|
|
96
|
+
exports.default = Namespace;
|
|
97
|
+
;
|
|
98
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _node = require('./node');
|
|
6
|
+
|
|
7
|
+
var _node2 = _interopRequireDefault(_node);
|
|
8
|
+
|
|
9
|
+
var _types = require('./types');
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
18
|
+
|
|
19
|
+
var Nesting = function (_Node) {
|
|
20
|
+
_inherits(Nesting, _Node);
|
|
21
|
+
|
|
22
|
+
function Nesting(opts) {
|
|
23
|
+
_classCallCheck(this, Nesting);
|
|
24
|
+
|
|
25
|
+
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
|
|
26
|
+
|
|
27
|
+
_this.type = _types.NESTING;
|
|
28
|
+
_this.value = '&';
|
|
29
|
+
return _this;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return Nesting;
|
|
33
|
+
}(_node2.default);
|
|
34
|
+
|
|
35
|
+
exports.default = Nesting;
|
|
36
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
6
|
+
|
|
7
|
+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
8
|
+
|
|
9
|
+
var _util = require('../util');
|
|
10
|
+
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
|
|
13
|
+
var cloneNode = function cloneNode(obj, parent) {
|
|
14
|
+
if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) {
|
|
15
|
+
return obj;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var cloned = new obj.constructor();
|
|
19
|
+
|
|
20
|
+
for (var i in obj) {
|
|
21
|
+
if (!obj.hasOwnProperty(i)) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
var value = obj[i];
|
|
25
|
+
var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
|
|
26
|
+
|
|
27
|
+
if (i === 'parent' && type === 'object') {
|
|
28
|
+
if (parent) {
|
|
29
|
+
cloned[i] = parent;
|
|
30
|
+
}
|
|
31
|
+
} else if (value instanceof Array) {
|
|
32
|
+
cloned[i] = value.map(function (j) {
|
|
33
|
+
return cloneNode(j, cloned);
|
|
34
|
+
});
|
|
35
|
+
} else {
|
|
36
|
+
cloned[i] = cloneNode(value, cloned);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return cloned;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var Node = function () {
|
|
44
|
+
function Node() {
|
|
45
|
+
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
46
|
+
|
|
47
|
+
_classCallCheck(this, Node);
|
|
48
|
+
|
|
49
|
+
Object.assign(this, opts);
|
|
50
|
+
this.spaces = this.spaces || {};
|
|
51
|
+
this.spaces.before = this.spaces.before || '';
|
|
52
|
+
this.spaces.after = this.spaces.after || '';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
Node.prototype.remove = function remove() {
|
|
56
|
+
if (this.parent) {
|
|
57
|
+
this.parent.removeChild(this);
|
|
58
|
+
}
|
|
59
|
+
this.parent = undefined;
|
|
60
|
+
return this;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
Node.prototype.replaceWith = function replaceWith() {
|
|
64
|
+
if (this.parent) {
|
|
65
|
+
for (var index in arguments) {
|
|
66
|
+
this.parent.insertBefore(this, arguments[index]);
|
|
67
|
+
}
|
|
68
|
+
this.remove();
|
|
69
|
+
}
|
|
70
|
+
return this;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
Node.prototype.next = function next() {
|
|
74
|
+
return this.parent.at(this.parent.index(this) + 1);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
Node.prototype.prev = function prev() {
|
|
78
|
+
return this.parent.at(this.parent.index(this) - 1);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
Node.prototype.clone = function clone() {
|
|
82
|
+
var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
83
|
+
|
|
84
|
+
var cloned = cloneNode(this);
|
|
85
|
+
for (var name in overrides) {
|
|
86
|
+
cloned[name] = overrides[name];
|
|
87
|
+
}
|
|
88
|
+
return cloned;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Some non-standard syntax doesn't follow normal escaping rules for css.
|
|
93
|
+
* This allows non standard syntax to be appended to an existing property
|
|
94
|
+
* by specifying the escaped value. By specifying the escaped value,
|
|
95
|
+
* illegal characters are allowed to be directly inserted into css output.
|
|
96
|
+
* @param {string} name the property to set
|
|
97
|
+
* @param {any} value the unescaped value of the property
|
|
98
|
+
* @param {string} valueEscaped optional. the escaped value of the property.
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
Node.prototype.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {
|
|
103
|
+
if (!this.raws) {
|
|
104
|
+
this.raws = {};
|
|
105
|
+
}
|
|
106
|
+
var originalValue = this[name];
|
|
107
|
+
var originalEscaped = this.raws[name];
|
|
108
|
+
this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.
|
|
109
|
+
if (originalEscaped || valueEscaped !== value) {
|
|
110
|
+
this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
|
|
111
|
+
} else {
|
|
112
|
+
delete this.raws[name]; // delete any escaped value that was created by the setter.
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Some non-standard syntax doesn't follow normal escaping rules for css.
|
|
118
|
+
* This allows the escaped value to be specified directly, allowing illegal
|
|
119
|
+
* characters to be directly inserted into css output.
|
|
120
|
+
* @param {string} name the property to set
|
|
121
|
+
* @param {any} value the unescaped value of the property
|
|
122
|
+
* @param {string} valueEscaped the escaped value of the property.
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
Node.prototype.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {
|
|
127
|
+
if (!this.raws) {
|
|
128
|
+
this.raws = {};
|
|
129
|
+
}
|
|
130
|
+
this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
|
|
131
|
+
this.raws[name] = valueEscaped;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* When you want a value to passed through to CSS directly. This method
|
|
136
|
+
* deletes the corresponding raw value causing the stringifier to fallback
|
|
137
|
+
* to the unescaped value.
|
|
138
|
+
* @param {string} name the property to set.
|
|
139
|
+
* @param {any} value The value that is both escaped and unescaped.
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
Node.prototype.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {
|
|
144
|
+
this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
|
|
145
|
+
if (this.raws) {
|
|
146
|
+
delete this.raws[name];
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @param {number} line The number (starting with 1)
|
|
153
|
+
* @param {number} column The column number (starting with 1)
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
Node.prototype.isAtPosition = function isAtPosition(line, column) {
|
|
158
|
+
if (this.source && this.source.start && this.source.end) {
|
|
159
|
+
if (this.source.start.line > line) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
if (this.source.end.line < line) {
|
|
163
|
+
return false;
|
|
164
|
+
}
|
|
165
|
+
if (this.source.start.line === line && this.source.start.column > column) {
|
|
166
|
+
return false;
|
|
167
|
+
}
|
|
168
|
+
if (this.source.end.line === line && this.source.end.column < column) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
return undefined;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
Node.prototype.stringifyProperty = function stringifyProperty(name) {
|
|
177
|
+
return this.raws && this.raws[name] || this[name];
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
Node.prototype.toString = function toString() {
|
|
181
|
+
return [this.rawSpaceBefore, String(this.stringifyProperty("value")), this.rawSpaceAfter].join('');
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
_createClass(Node, [{
|
|
185
|
+
key: 'rawSpaceBefore',
|
|
186
|
+
get: function get() {
|
|
187
|
+
var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
|
|
188
|
+
if (rawSpace === undefined) {
|
|
189
|
+
rawSpace = this.spaces && this.spaces.before;
|
|
190
|
+
}
|
|
191
|
+
return rawSpace || "";
|
|
192
|
+
},
|
|
193
|
+
set: function set(raw) {
|
|
194
|
+
(0, _util.ensureObject)(this, "raws", "spaces");
|
|
195
|
+
this.raws.spaces.before = raw;
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
key: 'rawSpaceAfter',
|
|
199
|
+
get: function get() {
|
|
200
|
+
var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
|
|
201
|
+
if (rawSpace === undefined) {
|
|
202
|
+
rawSpace = this.spaces.after;
|
|
203
|
+
}
|
|
204
|
+
return rawSpace || "";
|
|
205
|
+
},
|
|
206
|
+
set: function set(raw) {
|
|
207
|
+
(0, _util.ensureObject)(this, "raws", "spaces");
|
|
208
|
+
this.raws.spaces.after = raw;
|
|
209
|
+
}
|
|
210
|
+
}]);
|
|
211
|
+
|
|
212
|
+
return Node;
|
|
213
|
+
}();
|
|
214
|
+
|
|
215
|
+
exports.default = Node;
|
|
216
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _container = require('./container');
|
|
6
|
+
|
|
7
|
+
var _container2 = _interopRequireDefault(_container);
|
|
8
|
+
|
|
9
|
+
var _types = require('./types');
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
18
|
+
|
|
19
|
+
var Pseudo = function (_Container) {
|
|
20
|
+
_inherits(Pseudo, _Container);
|
|
21
|
+
|
|
22
|
+
function Pseudo(opts) {
|
|
23
|
+
_classCallCheck(this, Pseudo);
|
|
24
|
+
|
|
25
|
+
var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
|
|
26
|
+
|
|
27
|
+
_this.type = _types.PSEUDO;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Pseudo.prototype.toString = function toString() {
|
|
32
|
+
var params = this.length ? '(' + this.map(String).join(',') + ')' : '';
|
|
33
|
+
return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join('');
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return Pseudo;
|
|
37
|
+
}(_container2.default);
|
|
38
|
+
|
|
39
|
+
exports.default = Pseudo;
|
|
40
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
6
|
+
|
|
7
|
+
var _container = require('./container');
|
|
8
|
+
|
|
9
|
+
var _container2 = _interopRequireDefault(_container);
|
|
10
|
+
|
|
11
|
+
var _types = require('./types');
|
|
12
|
+
|
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
+
|
|
15
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
+
|
|
17
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
18
|
+
|
|
19
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
20
|
+
|
|
21
|
+
var Root = function (_Container) {
|
|
22
|
+
_inherits(Root, _Container);
|
|
23
|
+
|
|
24
|
+
function Root(opts) {
|
|
25
|
+
_classCallCheck(this, Root);
|
|
26
|
+
|
|
27
|
+
var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
|
|
28
|
+
|
|
29
|
+
_this.type = _types.ROOT;
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Root.prototype.toString = function toString() {
|
|
34
|
+
var str = this.reduce(function (memo, selector) {
|
|
35
|
+
memo.push(String(selector));
|
|
36
|
+
return memo;
|
|
37
|
+
}, []).join(',');
|
|
38
|
+
return this.trailingComma ? str + ',' : str;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
Root.prototype.error = function error(message, options) {
|
|
42
|
+
if (this._error) {
|
|
43
|
+
return this._error(message, options);
|
|
44
|
+
} else {
|
|
45
|
+
return new Error(message);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
_createClass(Root, [{
|
|
50
|
+
key: 'errorGenerator',
|
|
51
|
+
set: function set(handler) {
|
|
52
|
+
this._error = handler;
|
|
53
|
+
}
|
|
54
|
+
}]);
|
|
55
|
+
|
|
56
|
+
return Root;
|
|
57
|
+
}(_container2.default);
|
|
58
|
+
|
|
59
|
+
exports.default = Root;
|
|
60
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _container = require('./container');
|
|
6
|
+
|
|
7
|
+
var _container2 = _interopRequireDefault(_container);
|
|
8
|
+
|
|
9
|
+
var _types = require('./types');
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
18
|
+
|
|
19
|
+
var Selector = function (_Container) {
|
|
20
|
+
_inherits(Selector, _Container);
|
|
21
|
+
|
|
22
|
+
function Selector(opts) {
|
|
23
|
+
_classCallCheck(this, Selector);
|
|
24
|
+
|
|
25
|
+
var _this = _possibleConstructorReturn(this, _Container.call(this, opts));
|
|
26
|
+
|
|
27
|
+
_this.type = _types.SELECTOR;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return Selector;
|
|
32
|
+
}(_container2.default);
|
|
33
|
+
|
|
34
|
+
exports.default = Selector;
|
|
35
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _node = require('./node');
|
|
6
|
+
|
|
7
|
+
var _node2 = _interopRequireDefault(_node);
|
|
8
|
+
|
|
9
|
+
var _types = require('./types');
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
18
|
+
|
|
19
|
+
var String = function (_Node) {
|
|
20
|
+
_inherits(String, _Node);
|
|
21
|
+
|
|
22
|
+
function String(opts) {
|
|
23
|
+
_classCallCheck(this, String);
|
|
24
|
+
|
|
25
|
+
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
|
|
26
|
+
|
|
27
|
+
_this.type = _types.STRING;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return String;
|
|
32
|
+
}(_node2.default);
|
|
33
|
+
|
|
34
|
+
exports.default = String;
|
|
35
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
|
|
5
|
+
var _namespace = require('./namespace');
|
|
6
|
+
|
|
7
|
+
var _namespace2 = _interopRequireDefault(_namespace);
|
|
8
|
+
|
|
9
|
+
var _types = require('./types');
|
|
10
|
+
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
18
|
+
|
|
19
|
+
var Tag = function (_Namespace) {
|
|
20
|
+
_inherits(Tag, _Namespace);
|
|
21
|
+
|
|
22
|
+
function Tag(opts) {
|
|
23
|
+
_classCallCheck(this, Tag);
|
|
24
|
+
|
|
25
|
+
var _this = _possibleConstructorReturn(this, _Namespace.call(this, opts));
|
|
26
|
+
|
|
27
|
+
_this.type = _types.TAG;
|
|
28
|
+
return _this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return Tag;
|
|
32
|
+
}(_namespace2.default);
|
|
33
|
+
|
|
34
|
+
exports.default = Tag;
|
|
35
|
+
module.exports = exports['default'];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
var TAG = exports.TAG = 'tag';
|
|
5
|
+
var STRING = exports.STRING = 'string';
|
|
6
|
+
var SELECTOR = exports.SELECTOR = 'selector';
|
|
7
|
+
var ROOT = exports.ROOT = 'root';
|
|
8
|
+
var PSEUDO = exports.PSEUDO = 'pseudo';
|
|
9
|
+
var NESTING = exports.NESTING = 'nesting';
|
|
10
|
+
var ID = exports.ID = 'id';
|
|
11
|
+
var COMMENT = exports.COMMENT = 'comment';
|
|
12
|
+
var COMBINATOR = exports.COMBINATOR = 'combinator';
|
|
13
|
+
var CLASS = exports.CLASS = 'class';
|
|
14
|
+
var ATTRIBUTE = exports.ATTRIBUTE = 'attribute';
|
|
15
|
+
var UNIVERSAL = exports.UNIVERSAL = 'universal';
|