diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 4af9f46..f61dfea 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ -# These are supported funding model platforms - -github: CoCreate-app +# These are supported funding model platforms + +github: CoCreate-app diff --git a/.github/workflows/automated.yml b/.github/workflows/automated.yml index 81d9483..c8ea0ff 100644 --- a/.github/workflows/automated.yml +++ b/.github/workflows/automated.yml @@ -1,5 +1,5 @@ -name: Automated -"on": +name: Automated Workflow +on: push: branches: - master @@ -8,7 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 - name: Jaid/action-sync-node-meta uses: jaid/action-sync-node-meta@v1.4.0 with: @@ -18,9 +22,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 14 - name: Semantic Release - uses: cycjimmy/semantic-release-action@v2 + uses: cycjimmy/semantic-release-action@v3 id: semantic with: extra_plugins: | @@ -28,56 +36,9 @@ jobs: @semantic-release/git @semantic-release/github env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.GITHUB }}" NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" outputs: new_release_published: "${{ steps.semantic.outputs.new_release_published }}" new_release_version: "${{ steps.semantic.outputs.new_release_version }}" - cdn: - runs-on: ubuntu-latest - needs: release - if: needs.release.outputs.new_release_published == 'true' - env: - VERSION: "${{ needs.release.outputs.new_release_version }}" - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: setup nodejs - uses: actions/setup-node@v2 - with: - node-version: 14.15.4 - - name: yarn install - run: > - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > - .npmrc - - yarn install - - name: yarn build - run: yarn build - - name: upload bundle as version - uses: CoCreate-app/CoCreate-s3@master - with: - aws-key-id: "${{ secrets.AWSACCESSKEYID }}" - aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}" - bucket: testcrudbucket - source: ./dist - destination: "/css-parser/${{env.VERSION}}" - acl: public-read - - name: upload bundle as latest - uses: CoCreate-app/CoCreate-s3@master - with: - aws-key-id: "${{ secrets.AWSACCESSKEYID }}" - aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}" - bucket: testcrudbucket - source: ./dist - destination: /css-parser/latest - acl: public-read - invalidations: true - docs: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: update documentation - uses: CoCreate-app/CoCreate-docs@master diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 5a96888..5238b65 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -1,44 +1,44 @@ -name: Manual Workflow -on: - workflow_dispatch: - inputs: - invalidations: - description: | - If set to 'true', invalidates previous upload. - default: "true" - required: true - -jobs: - cdn: - runs-on: ubuntu-latest - env: - DRY_RUN: ${{ github.event.inputs.dry_run }} - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: setup nodejs - uses: actions/setup-node@v2 - with: - node-version: 14.15.4 - - name: yarn install - run: > - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > - .npmrc - - yarn install - - name: yarn build - run: yarn build - - name: upload latest bundle - uses: CoCreate-app/CoCreate-s3@master - with: - aws-key-id: "${{ secrets.AWSACCESSKEYID }}" - aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}" - distributionId: "${{ secrets.DISTRIBUTION_ID }}" - bucket: testcrudbucket - source: ./dist - destination: /css-parser/latest - acl: public-read - invalidations: ${{ github.event.inputs.invalidations }} +name: Manual Workflow +on: + workflow_dispatch: + inputs: + invalidations: + description: | + If set to 'true', invalidates previous upload. + default: "true" + required: true + +jobs: + cdn: + runs-on: ubuntu-latest + env: + DRY_RUN: ${{ github.event.inputs.dry_run }} + GITHUB_TOKEN: "${{ secrets.GITHUB }}" + NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: setup nodejs + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: yarn install + run: > + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > + .npmrc + + yarn install + - name: yarn build + run: yarn build + - name: upload latest bundle + uses: CoCreate-app/CoCreate-s3@master + with: + aws-key-id: "${{ secrets.AWSACCESSKEYID }}" + aws-access-key: "${{ secrets.AWSSECERTACCESSKEY }}" + distributionId: "${{ secrets.DISTRIBUTION_ID }}" + bucket: testcrudbucket + source: ./dist + destination: /css-parser/latest + acl: public-read + invalidations: ${{ github.event.inputs.invalidations }} diff --git a/.gitignore b/.gitignore index 97ec91f..c8ae56f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,14 @@ -# ignore -node_modules -dist -.npmrc -yarn.lock - -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* +# ignore +node_modules +dist +package-lock.json +yarn.lock +pnpm-lock.yaml + +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* diff --git a/CHANGELOG.md b/CHANGELOG.md index b177133..0155ef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,84 +1,964 @@ -## [1.0.11](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.10...v1.0.11) (2022-10-02) +# [1.17.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.16.3...v1.17.0) (2025-10-11) + + +### Features + +* enhance media query parsing to support height-based breakpoints and improve condition handling ([41e919d](https://github.com/CoCreate-app/CoCreate-css-parser/commit/41e919db3b6bb24f21b30ddd575f342637b8dc38)) +* expand media query support with height breakpoints and enhance range definitions ([17bf842](https://github.com/CoCreate-app/CoCreate-css-parser/commit/17bf842652deb928dde3f8a59fcb10f9ad12c4f7)) + +## [1.16.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.16.2...v1.16.3) (2025-05-01) + + +### Bug Fixes + +* update [@cocreate](https://github.com/cocreate) dependencies ([8e0e4a4](https://github.com/CoCreate-app/CoCreate-css-parser/commit/8e0e4a48930bb28e8d5ec3b1c4c496ce3c5b9c96)) + +## [1.16.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.16.1...v1.16.2) (2025-04-30) + + +### Bug Fixes + +* added css-loader ([4dc5823](https://github.com/CoCreate-app/CoCreate-css-parser/commit/4dc582334ab5c8ba48e96871fdadc9c94c04897a)) +* update query attributes ([a831817](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a831817b332e792a5c8a5d842d4966befd35ae2f)) +* updated cocreate modules versions ([67356f2](https://github.com/CoCreate-app/CoCreate-css-parser/commit/67356f27997750f8c948f16be5c515e299fc5ed5)) +* webpack.config and devdependencies ([9595a6b](https://github.com/CoCreate-app/CoCreate-css-parser/commit/9595a6b92ed9381570f6775548f4927c4a991f7f)) + +## [1.16.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.16.0...v1.16.1) (2025-04-11) + + +### Bug Fixes + +* update observer obseve parame to type and and attribute name to attributeFilter ([90fe9a4](https://github.com/CoCreate-app/CoCreate-css-parser/commit/90fe9a46542054abec5d4798f7699e9762b0cca6)) + +# [1.16.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.15.0...v1.16.0) (2025-01-18) + + +### Features + +* debounce save ([548ead8](https://github.com/CoCreate-app/CoCreate-css-parser/commit/548ead85bcae6b6f308757ed5ec776a92e8e3b2e)) + +# [1.15.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.14.5...v1.15.0) (2024-11-04) ### Bug Fixes -* minor bug fixes ([632491d](https://github.com/CoCreate-app/CoCreate-css-parser/commit/632491d18135eb3ea6b10e51e090b9ab0871dda9)) +* observer taget has been renamed to selector ([7ae87bb](https://github.com/CoCreate-app/CoCreate-css-parser/commit/7ae87bbdb2397055f7f74fe698c6e2290f54f6b7)) +* pretier.config.js and file formating ([5e18a18](https://github.com/CoCreate-app/CoCreate-css-parser/commit/5e18a18ef0b11accc68d810e89c0119f13f01216)) + + +### Features + +* add prettier.config.js and format files ([160d5f8](https://github.com/CoCreate-app/CoCreate-css-parser/commit/160d5f85171a3c96fc3225d1b4558692e67afd7b)) +* add prettier.config.js and format files ([d94b026](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d94b0267e7560bb7d7e212ddb4a732f67fa5a6ad)) -## [1.0.10](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.9...v1.0.10) (2022-10-02) +## [1.14.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.14.4...v1.14.5) (2024-06-12) ### Bug Fixes -* bump @cocreate/hosting and @cocreate/socket-client ([3f41bc9](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3f41bc93dc7b96c5a8a6e73f55eef82a367f1514)) +* bump cocreate dependencies ([ea1b6fc](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ea1b6fca49f2dc55cceba26f4419efbfa76f4f79)) +* Handlig importan in theme rules ([7078105](https://github.com/CoCreate-app/CoCreate-css-parser/commit/70781057f761557080360535d9ba47ef7aee8e67)) +* handling dark and light mode ([5217148](https://github.com/CoCreate-app/CoCreate-css-parser/commit/52171481883c33d30650366ef70f3b19445266d2)) +* svg icon class ([3864815](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3864815ef136a8b95c7a871fbd69bb37a05583d0)) -## [1.0.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.8...v1.0.9) (2022-10-01) +## [1.14.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.14.3...v1.14.4) (2024-04-29) ### Bug Fixes -* bump dependencies ([cacf527](https://github.com/CoCreate-app/CoCreate-css-parser/commit/cacf527a04427476726ddbf0724f6a80b87725bd)) -* CoCreate.cssParser global scope ([a10d581](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a10d581e45f84e1e96cd8b58c4d20a68e9b6e6de)) +* bump cocreate dependencies ([48e6acc](https://github.com/CoCreate-app/CoCreate-css-parser/commit/48e6acc95ba197d076d4356d59e1ad3bc513913d)) -## [1.0.8](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.7...v1.0.8) (2022-09-30) +## [1.14.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.14.2...v1.14.3) (2024-02-05) ### Bug Fixes -* bump [@cocreate](https://github.com/cocreate) dependencies ([674a62f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/674a62f1c15b298225f4d3d0569d4cb2b6bff577)) +* Removed https://cdn.cocreate.app/latest/CoCreate.min.css ([7d59765](https://github.com/CoCreate-app/CoCreate-css-parser/commit/7d597658028de62476729c65fa844d1795b598de)) -## [1.0.7](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.6...v1.0.7) (2022-09-30) +## [1.14.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.14.1...v1.14.2) (2024-01-30) ### Bug Fixes -* bump [@cocreate](https://github.com/cocreate) dependencies ([9ebdb31](https://github.com/CoCreate-app/CoCreate-css-parser/commit/9ebdb311561f0c4d4c9b07c12a1af765ab5d11e0)) +* Handling of !important when @ mediaQueries are defined ([b38e4d9](https://github.com/CoCreate-app/CoCreate-css-parser/commit/b38e4d9d6cb4d4651b4274a19b52a1464c9efd52)) -## [1.0.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.5...v1.0.6) (2022-09-30) +## [1.14.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.14.0...v1.14.1) (2023-12-09) ### Bug Fixes -* bump [@cocreate](https://github.com/cocreate) dependencies ([eaf3f5c](https://github.com/CoCreate-app/CoCreate-css-parser/commit/eaf3f5ceb4bb98816c5ec81b44e2d3cd8e3f908f)) +* oder of splice ([d03c2cf](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d03c2cfd26c9f54c77ab8f1aba934df2cefcfdc2)) -## [1.0.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.4...v1.0.5) (2022-09-30) +# [1.14.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.13.0...v1.14.0) (2023-11-25) + + +### Features + +* upgrade dependencies for latest features and fixes ([2e2070e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/2e2070ea19cb36613e9824beacc9691542e8eaf2)) + +# [1.13.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.12.0...v1.13.0) (2023-11-25) ### Bug Fixes -* bump dependencies ([333a21a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/333a21a1f94ba0cc36d21a93e12fe5091307c689)) +* update nav, edit button and css path ([1487af1](https://github.com/CoCreate-app/CoCreate-css-parser/commit/1487af11164027dc7dc2d1bf2d8c48af93703879)) -## [1.0.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.3...v1.0.4) (2022-09-29) + +### Features + +* upgrade dependencies for latest features and fixes ([9c42dfb](https://github.com/CoCreate-app/CoCreate-css-parser/commit/9c42dfb477ec169f4167e9aa5e84b308e134b177)) + +# [1.12.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.9...v1.12.0) (2023-11-19) + + +### Features + +* update dependecies for th latest features and bug fixes ([2eb2598](https://github.com/CoCreate-app/CoCreate-css-parser/commit/2eb25988167de863f6b3e7255d120b4eb5f9ae15)) + +## [1.11.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.8...v1.11.9) (2023-11-12) ### Bug Fixes -* config renameed to CoCreateConfig ([25c9442](https://github.com/CoCreate-app/CoCreate-css-parser/commit/25c9442d089de8331e218b3ebbeac7904d6bac54)) +* bump dependencies for latest features ([363b0ce](https://github.com/CoCreate-app/CoCreate-css-parser/commit/363b0ce26eae056decda319f1a325435615d3fd9)) -## [1.0.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.2...v1.0.3) (2022-09-22) +## [1.11.8](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.7...v1.11.8) (2023-11-09) ### Bug Fixes -* bumped dependencies ([20ded50](https://github.com/CoCreate-app/CoCreate-css-parser/commit/20ded50cae017ad84a9ac9570d5a31cf86cb0dba)) +* meta name typo ([e6cdb81](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e6cdb8174495e9a4085e4bf4c4e920b0ce1e03d7)) -## [1.0.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.1...v1.0.2) (2022-09-01) +## [1.11.7](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.6...v1.11.7) (2023-11-03) ### Bug Fixes -* bump all of [@cocreate](https://github.com/cocreate) dependencies ([e3166f7](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e3166f719d7a27255a838748652f53f8e82581be)) +* favicon.ico path ([ef13533](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ef1353378259ab4c63f000cad30271af9c81891a)) +* update dependencies to the lates versions ([c9e80e2](https://github.com/CoCreate-app/CoCreate-css-parser/commit/c9e80e26398daae9e699f57f68ad97731a77f730)) -## [1.0.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.0...v1.0.1) (2022-07-31) +## [1.11.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.5...v1.11.6) (2023-10-25) ### Bug Fixes -* update readme ([ad98442](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ad984428d2ef0d8ac9303e4c760cf79c941023d5)) +* bump dependencies ([4b27254](https://github.com/CoCreate-app/CoCreate-css-parser/commit/4b27254d8b574ec6f5732f03aa0f440dd2ddfad8)) + +## [1.11.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.4...v1.11.5) (2023-10-16) + + +### Bug Fixes + +* if parser not explicitly set to false observer will observe classes ([510343b](https://github.com/CoCreate-app/CoCreate-css-parser/commit/510343b3fd6d794aef71b39e4372eeed025e6bb1)) +* parse conditions ([8a9558b](https://github.com/CoCreate-app/CoCreate-css-parser/commit/8a9558b63cf47991f779cc3adcbea23cbb3c762e)) + +## [1.11.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.3...v1.11.4) (2023-10-14) + + +### Bug Fixes + +* bump dependencies ([2b9c5fa](https://github.com/CoCreate-app/CoCreate-css-parser/commit/2b9c5fa5d3447412ddad0091f35ab4590c0b01b9)) + +## [1.11.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.2...v1.11.3) (2023-10-09) + + +### Bug Fixes + +* bump dependencies ([01b2e82](https://github.com/CoCreate-app/CoCreate-css-parser/commit/01b2e822dcc5c28151e59d94d225286c229bfeae)) + +## [1.11.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.1...v1.11.2) (2023-10-09) + + +### Bug Fixes + +* bump dependencies ([ba5ff75](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ba5ff75ae3db81dbf5918ca5e3154730526c0044)) + +## [1.11.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.11.0...v1.11.1) (2023-09-18) + + +### Bug Fixes + +* Add path and pathname ([3f4825e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3f4825e1898930ab6f643c30d51acdcc68b426fb)) +* Update CoCreate depndencies to latest versions ([b711c68](https://github.com/CoCreate-app/CoCreate-css-parser/commit/b711c684209737a7376eac2a6ae8d7ad2f1bac3a)) + +# [1.11.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.10.1...v1.11.0) (2023-09-17) + + +### Features + +* save css src with name, path, pathname and content-type ([572c34e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/572c34e8ebd204b901bcc02742ba7824d90ff5be)) + +## [1.10.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.10.0...v1.10.1) (2023-08-21) + + +### Bug Fixes + +* bump dependencies ([e9b9644](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e9b964436d854fbc1c851ca9eaeb5345d5c2be21)) + +# [1.10.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.9.1...v1.10.0) (2023-08-21) + + +### Features + +* Update cocreate dependencies for the latest features and bug fixes ([97d655d](https://github.com/CoCreate-app/CoCreate-css-parser/commit/97d655d4fc49ebe492394c57557f4bff03158474)) + +## [1.9.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.9.0...v1.9.1) (2023-08-21) + + +### Bug Fixes + +* /dist/CoCreate.js updated to https://CoCreate.app/dist/CoCreate.js ([08cb9e5](https://github.com/CoCreate-app/CoCreate-css-parser/commit/08cb9e53ed94e67e898d9562415c5b05ec4264db)) +* replace cdn with /dist ([688b4bc](https://github.com/CoCreate-app/CoCreate-css-parser/commit/688b4bc7c89e6436f48dab5406c6f86c138daaa2)) +* update file uploader ([549af24](https://github.com/CoCreate-app/CoCreate-css-parser/commit/549af240382c6738b1b71a71fa522ec58e3654da)) + +# [1.9.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.8.0...v1.9.0) (2023-08-17) + + +### Features + +* bump cocreate dependencies for the latest updates and features ([ffb68b5](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ffb68b5fcd17c4c0a5ef97f4862c9101c64e6ac1)) + +# [1.8.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.29...v1.8.0) (2023-08-16) + + +### Bug Fixes -# 1.0.0 (2022-07-31) +* crud attributes renamed ([4e317ef](https://github.com/CoCreate-app/CoCreate-css-parser/commit/4e317efe622a6a741e7f26bcc26a5f70daf969c0)) +* Remove redundant dependency ([ca37c3a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ca37c3a9b101cfde1b0f95f16ff8ec5c1a84b76c)) +* replace -target -selector ([345d8af](https://github.com/CoCreate-app/CoCreate-css-parser/commit/345d8af1b8cf67fe98ee2314f52156701991076a)) +* webpack.config and package.json make use of mode=production instead of process.env ([6382cc5](https://github.com/CoCreate-app/CoCreate-css-parser/commit/6382cc56209d43a4b35309ef1c5745baccf3e0f4)) ### Features +* element.setValue and Remove unused import statement and optimize code for joining parsedCSS and linkCSS arrays into a single string with unique values. Also, remove unused code related to saving the linkTag. ([4e0affd](https://github.com/CoCreate-app/CoCreate-css-parser/commit/4e0affd917c4dfd7cab0ae619490dcc2d0fc4a78)) +* getValue function and use element.save() to execute crud save ([d2a289f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d2a289fad2c17058baa733f2068087ebd334a954)) +* name attribute and variable renamed to key ([3a130e3](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3a130e38f88c23c34ba294023f66732992103d6f)) + +## [1.7.29](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.28...v1.7.29) (2023-06-14) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([21afea7](https://github.com/CoCreate-app/CoCreate-css-parser/commit/21afea7d9a0fc7264770a4643ccd93ed3d914421)) + +## [1.7.28](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.27...v1.7.28) (2023-06-11) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([991727c](https://github.com/CoCreate-app/CoCreate-css-parser/commit/991727c18270dd31fb1c2d9f1f1389bde125d4bf)) + +## [1.7.27](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.26...v1.7.27) (2023-06-11) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([7f3e1e1](https://github.com/CoCreate-app/CoCreate-css-parser/commit/7f3e1e19a3af935b5961fb739abfd03583feb518)) + +## [1.7.26](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.25...v1.7.26) (2023-06-11) + + +### Bug Fixes + +* testing workflow ([2afb53e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/2afb53ee348744cf59ca595578c12642c248e093)) + +## [1.7.25](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.24...v1.7.25) (2023-06-11) + + +### Bug Fixes + +* testing workflow ([4d42136](https://github.com/CoCreate-app/CoCreate-css-parser/commit/4d421368a0dc5c21477ed2028b7bc712c01570cd)) + +## [1.7.24](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.23...v1.7.24) (2023-06-11) + + +### Bug Fixes + +* testing workflow ([e9d022a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e9d022a0d778baa855c2e00d943f88bca0c2e8dd)) +* testing workflow ([e879d57](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e879d57d32ab403df8c22ee7e364949cd33ba40b)) + +## [1.7.23](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.22...v1.7.23) (2023-06-11) + + +### Bug Fixes + +* testing workflow ([29198e6](https://github.com/CoCreate-app/CoCreate-css-parser/commit/29198e6a44fdeffe862f86c0232974301f4f5d65)) + +## [1.7.22](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.21...v1.7.22) (2023-06-11) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([75f7c17](https://github.com/CoCreate-app/CoCreate-css-parser/commit/75f7c17b1c850961a0bcff014d9c7d1aa8f205c4)) + +## [1.7.21](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.20...v1.7.21) (2023-06-11) + + +### Bug Fixes + +* postintall error ([5f8aadf](https://github.com/CoCreate-app/CoCreate-css-parser/commit/5f8aadf2bd2d9065374e19f58d6a94b00b5c4227)) + +## [1.7.20](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.19...v1.7.20) (2023-06-11) + + +### Bug Fixes + +* @cocreate/cli moved to dependencies ([12a6e48](https://github.com/CoCreate-app/CoCreate-css-parser/commit/12a6e487eaa1ca5bd6981682c19f38b999170853)) + +## [1.7.19](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.18...v1.7.19) (2023-06-11) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([3919637](https://github.com/CoCreate-app/CoCreate-css-parser/commit/39196372fef37fe7d437fa0179c607fc81bd53e2)) + +## [1.7.18](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.17...v1.7.18) (2023-06-11) + + +### Bug Fixes + +* renamed hosts to host. the value can be a string or an array of strings ([a647c92](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a647c92f1ad530b497731ff045d8e4ce31fea44e)) + +## [1.7.17](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.16...v1.7.17) (2023-06-10) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([b065a24](https://github.com/CoCreate-app/CoCreate-css-parser/commit/b065a24d730fd8401f975fb37b1073c84ee2636e)) + +## [1.7.16](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.15...v1.7.16) (2023-06-10) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([3e524a6](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3e524a6c6fcda823906cdfed382642c8c3643e4e)) + +## [1.7.15](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.14...v1.7.15) (2023-06-04) + + +### Bug Fixes + +* Refactor CoCreate.config.js to remove hard-coded credentials ([a96f369](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a96f369e94d031dd78f5724ddb143a142601e122)) + +## [1.7.14](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.13...v1.7.14) (2023-06-04) + + +### Bug Fixes + +* replaced secert GITHUB_TOKEN with GITHUB ([1ff3965](https://github.com/CoCreate-app/CoCreate-css-parser/commit/1ff3965d420c04486ac52979e7189630db8c7722)) +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([a3ee4d0](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a3ee4d013e94facaecffcf4580ca788908acf4d4)) + +## [1.7.13](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.12...v1.7.13) (2023-06-04) + + +### Bug Fixes + +* **semantic-release:** worklow error solved by running node version 14 ([5d887e8](https://github.com/CoCreate-app/CoCreate-css-parser/commit/5d887e89191e51866c035d3e75c3e80d7e4f2be0)) + +## [1.7.12](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.11...v1.7.12) (2023-06-02) + + +### Bug Fixes + +* format demo html ([d5d9410](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d5d9410320d8e01e17d65c99a7ca501e2e7504dd)) +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([795cf35](https://github.com/CoCreate-app/CoCreate-css-parser/commit/795cf35a7c5a09da2dc58c20f47a2a73714b837d)) + +## [1.7.11](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.10...v1.7.11) (2023-05-21) + + +### Bug Fixes + +* Update dependencies versions for [@cocreate](https://github.com/cocreate) libraries ([971eb2a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/971eb2a7af755333c0e5f16ca34ea19610279a8a)) + +## [1.7.10](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.9...v1.7.10) (2023-05-19) + + +### Bug Fixes + +* update packages to latest version. This commit updates various packages in the dependencies section of the package.json file to their latest published versions, thereby fixing multiple bugs and improving overall performance. ([eb77a15](https://github.com/CoCreate-app/CoCreate-css-parser/commit/eb77a152c3b1d091c8fbe0b2e980ea35c13d0ca5)) + +## [1.7.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.8...v1.7.9) (2023-05-10) + + +### Bug Fixes + +* apikey renamed to key ([44837f9](https://github.com/CoCreate-app/CoCreate-css-parser/commit/44837f9a80cf59d92ceb846468dba179702a11c1)) + +## [1.7.8](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.7...v1.7.8) (2023-05-06) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies ([c854eb9](https://github.com/CoCreate-app/CoCreate-css-parser/commit/c854eb99b3e79fef0cd28c7fff94cc95ef86a594)) + +## [1.7.7](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.6...v1.7.7) (2023-05-01) + + +### Bug Fixes + +* update manifest.json to manifest.webmanifest ([d71bfd1](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d71bfd1dfc48ececc5c4111df8ea898cbada5195)) + +## [1.7.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.5...v1.7.6) (2023-05-01) + + +### Bug Fixes + +* replace fontawesome with svg ([6cba9af](https://github.com/CoCreate-app/CoCreate-css-parser/commit/6cba9afb598c866bd6e12c4d3d06e0774d609644)) + +## [1.7.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.4...v1.7.5) (2023-04-30) + + +### Bug Fixes + +* fullscreen target updated to fullscreen fullscreen-target ([23b03f1](https://github.com/CoCreate-app/CoCreate-css-parser/commit/23b03f1a55922279e771437d93f4740b53d4c8de)) +* package-lock.json and pnpm-lock.yaml added to .gitignore ([a7d8865](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a7d8865dbd603fd04b34424ad3396735ecd137ea)) +* removed toogle fullscreen icons. now using css content ([71953aa](https://github.com/CoCreate-app/CoCreate-css-parser/commit/71953aa86c7d0b29d5271fab9551bb7135786c17)) + +## [1.7.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.3...v1.7.4) (2023-04-24) + + +### Bug Fixes + +* updated worrkflows to v3 and node version 16 ([f34b788](https://github.com/CoCreate-app/CoCreate-css-parser/commit/f34b7885405c3e54791876db470430087020dce1)) + +## [1.7.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.2...v1.7.3) (2023-04-24) + + +### Bug Fixes + +* workflow node version updated 16 ([08fe7bd](https://github.com/CoCreate-app/CoCreate-css-parser/commit/08fe7bded189f71d4dfca56600339de100f30996)) + +## [1.7.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.1...v1.7.2) (2023-04-24) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies ([76eae36](https://github.com/CoCreate-app/CoCreate-css-parser/commit/76eae364b98a31c6f57a379f9557496fe8ba1a49)) + +## [1.7.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.7.0...v1.7.1) (2023-04-24) + + +### Bug Fixes + +* removed uglifyjs-webpack-plugin ([3227b95](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3227b95fb788f26c91c41112323e93b71f4ac220)) + +# [1.7.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.6.6...v1.7.0) (2023-04-24) + + +### Features + +* added pwa manifest ([5ab1f00](https://github.com/CoCreate-app/CoCreate-css-parser/commit/5ab1f00cb32264970b8ce81494fbc0db728e9e88)) + +## [1.6.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.6.5...v1.6.6) (2023-04-11) + + +### Bug Fixes + +* bump dependencies ([06f4284](https://github.com/CoCreate-app/CoCreate-css-parser/commit/06f42840aed3066bc237e05535d7de6b14d5514c)) + +## [1.6.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.6.4...v1.6.5) (2023-04-11) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies ([f4cff68](https://github.com/CoCreate-app/CoCreate-css-parser/commit/f4cff680f251c5961bf0b9caeda92a20cc4d4b07)) + +## [1.6.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.6.3...v1.6.4) (2023-04-11) + + +### Bug Fixes + +* renamed domains to hosts ([048c7f4](https://github.com/CoCreate-app/CoCreate-css-parser/commit/048c7f4f80a372e1c1ec52cf229ad83b5ea1b856)) + +## [1.6.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.6.2...v1.6.3) (2023-03-30) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies' ([e5a626f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e5a626f8ac7260fd354aab423c88d03d9470d615)) + +## [1.6.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.6.1...v1.6.2) (2023-03-16) + + +### Bug Fixes + +* bump dependencies' ([984f293](https://github.com/CoCreate-app/CoCreate-css-parser/commit/984f2931fbdad9150d6637bbabfb2b228be916c9)) + +## [1.6.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.6.0...v1.6.1) (2023-03-16) + + +### Bug Fixes + +* bump dependencies' ([3a8d160](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3a8d160cda160e1d109d9c7db3907c827b870cc1)) + +# [1.6.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.5.5...v1.6.0) (2023-03-16) + + +### Features + +* replaced get-value and set-value with a super charged version of CoCreate-events ([db8293f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/db8293f47770f39830585cef540ecb4a597c71ba)) + +## [1.5.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.5.4...v1.5.5) (2023-02-01) + + +### Bug Fixes + +* bump dependencies ([19f105e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/19f105e1a2c25727b233c5896707cbfe9755ed67)) + +## [1.5.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.5.3...v1.5.4) (2023-01-31) + + +### Bug Fixes + +* bump dependencies ([62f6e60](https://github.com/CoCreate-app/CoCreate-css-parser/commit/62f6e60df846adbad19c4df6449da4ebb81ee9b4)) + +## [1.5.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.5.2...v1.5.3) (2023-01-30) + + +### Bug Fixes + +* bump dependencies ([f0c6708](https://github.com/CoCreate-app/CoCreate-css-parser/commit/f0c6708fc03c30c16f1e21dea380a4d430942d66)) + +## [1.5.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.5.1...v1.5.2) (2023-01-29) + + +### Bug Fixes + +* bump dependencies ([6616994](https://github.com/CoCreate-app/CoCreate-css-parser/commit/66169943749900e5fb6c57dc30e077c7febe528c)) + +## [1.5.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.5.0...v1.5.1) (2023-01-29) + + +### Bug Fixes + +* bump dependencies ([56d0376](https://github.com/CoCreate-app/CoCreate-css-parser/commit/56d03766e4e2e89bd6caf17b7c19968f24b857a0)) + +# [1.5.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.9...v1.5.0) (2023-01-29) + + +### Features + +* import @cocreate/local-storage ([e71b717](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e71b71755f028c4073316dc5822e351d12cefa06)) + +## [1.4.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.8...v1.4.9) (2023-01-27) + + +### Bug Fixes + +* bump dependencies ([f013ecf](https://github.com/CoCreate-app/CoCreate-css-parser/commit/f013ecf17d4770bb6be479f45e058672cea994e4)) + +## [1.4.8](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.7...v1.4.8) (2023-01-13) + + +### Bug Fixes + +* bump dependencies ([7dce60b](https://github.com/CoCreate-app/CoCreate-css-parser/commit/7dce60bcf620dc2b01e164cd410949524080b1fe)) + +## [1.4.7](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.6...v1.4.7) (2023-01-10) + + +### Bug Fixes + +* bump dependencies ([5ab23e6](https://github.com/CoCreate-app/CoCreate-css-parser/commit/5ab23e6ab9c9175775972d7ab8fb0283a6b38fb3)) + +## [1.4.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.5...v1.4.6) (2023-01-09) + + +### Bug Fixes + +* bump dependnecies ([e83f940](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e83f9406ad93a35fc15477f6c9c0983598e5d4d3)) + +## [1.4.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.4...v1.4.5) (2023-01-06) + + +### Bug Fixes + +* bump dependencies, worklow [@v3](https://github.com/v3) ([aa5adf1](https://github.com/CoCreate-app/CoCreate-css-parser/commit/aa5adf1f7049a99819d2b90bbc75d666876f3ba1)) +* edit in github btn styles ([e9850ad](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e9850ad39a5e78bb5ff05ebe49215764ef431a2a)) + +## [1.4.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.3...v1.4.4) (2023-01-05) + + +### Bug Fixes + +* bump cdn to 1.39.4 ([991d804](https://github.com/CoCreate-app/CoCreate-css-parser/commit/991d804fc929d85d67dc091c976be35c75b69675)) +* bump dependencies ([f58b7bb](https://github.com/CoCreate-app/CoCreate-css-parser/commit/f58b7bbaa9ed9b451fcc8b42cf57e3af2672f67b)) + +## [1.4.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.2...v1.4.3) (2023-01-01) + + +### Bug Fixes + +* docs sanbox overflow ([9b74b92](https://github.com/CoCreate-app/CoCreate-css-parser/commit/9b74b9281fae6289bf0100d2cbd34df916955a8f)) + +## [1.4.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.1...v1.4.2) (2022-12-31) + + +### Bug Fixes + +* bump dependencies ([e0b9975](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e0b9975479a4fdbb11d44dac5cc2ac53e75f5d39)) + +## [1.4.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.4.0...v1.4.1) (2022-12-30) + + +### Bug Fixes + +* update config sources to use template braces with entry on src ([e45b99d](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e45b99d2c5b68258a91339ccb408740f1747847c)) + +# [1.4.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.9...v1.4.0) (2022-12-29) + + +### Bug Fixes + +* bump dependencies ([f223efd](https://github.com/CoCreate-app/CoCreate-css-parser/commit/f223efd0c97386e7d5ed04d8ebea7f49b5661788)) + + +### Features + +* debounce save function ([879a6dc](https://github.com/CoCreate-app/CoCreate-css-parser/commit/879a6dca783ccec04465cc621911f4ea7c1dcddb)) + +## [1.3.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.8...v1.3.9) (2022-12-27) + + +### Bug Fixes + +* bump dependecies ([bd09f05](https://github.com/CoCreate-app/CoCreate-css-parser/commit/bd09f05dedca9f016b49d8bd54b6b2d604c2e88b)) +* bump dependencies ([36288dd](https://github.com/CoCreate-app/CoCreate-css-parser/commit/36288dda9f659885127a1ab1ce55db6dc1db7ee9)) + +## [1.3.8](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.7...v1.3.8) (2022-12-25) + + +### Bug Fixes + +* bump dependencies ([d599ac5](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d599ac585d3d5af5ac4b75576ea9879e05f8af57)) +* bumpcdn to 1.34.4 ([c82f1c5](https://github.com/CoCreate-app/CoCreate-css-parser/commit/c82f1c58a9d91e03ea28de0b9448b7eb914235e4)) + +## [1.3.7](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.6...v1.3.7) (2022-12-23) + + +### Bug Fixes + +* bump dependnecies ([4791c5f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/4791c5f6966fe3bbdd60d044b9c9a86da76cec1f)) + +## [1.3.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.5...v1.3.6) (2022-12-22) + + +### Bug Fixes + +* bump dependencies ([83e3b2c](https://github.com/CoCreate-app/CoCreate-css-parser/commit/83e3b2cf6b3b4b6736ac21b0046d3671d3d71eea)) +* update cdn ([8505a52](https://github.com/CoCreate-app/CoCreate-css-parser/commit/8505a52ecc47a27d8c8a38edb9efff5accdb668a)) + +## [1.3.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.4...v1.3.5) (2022-12-22) + + +### Bug Fixes + +* update demos and bump dependencies ([5d01ba8](https://github.com/CoCreate-app/CoCreate-css-parser/commit/5d01ba85eb04f672b7bb931e4e597b7c8639e5c7)) + +## [1.3.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.3...v1.3.4) (2022-12-21) + + +### Bug Fixes + +* bump dependencies ([a4130a3](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a4130a34921db8bc7fbbf81e1e3522ad76e803af)) + +## [1.3.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.2...v1.3.3) (2022-12-20) + + +### Bug Fixes + +* bump dependencies ([820b274](https://github.com/CoCreate-app/CoCreate-css-parser/commit/820b274820278f4fb12f2da36e455e9dee2fa6ae)) +* style component name updated to css-parser ([1ceb045](https://github.com/CoCreate-app/CoCreate-css-parser/commit/1ceb0457785925929319da31745e9e4cea198478)) + +## [1.3.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.1...v1.3.2) (2022-12-15) + + +### Bug Fixes + +* add missing dev dependency style-loader ([3be1e23](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3be1e23fccf00f85eda339881d8441041a71abc6)) + +## [1.3.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.3.0...v1.3.1) (2022-12-14) + + +### Bug Fixes + +* init bug ([661b05a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/661b05ae77bb9cfadded41be397dc559e8d61b40)) + +# [1.3.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.2.5...v1.3.0) (2022-12-14) + + +### Features + +* oberver link tag for changes and react accordingly ([4f0112e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/4f0112e63e78a8360c934e90e53a36ca1aaeed20)) + +## [1.2.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.2.4...v1.2.5) (2022-12-13) + + +### Bug Fixes + +* removed un used devDependencies ([445b189](https://github.com/CoCreate-app/CoCreate-css-parser/commit/445b1891a4298d2c7a513e59ece13c02de158ab4)) + +## [1.2.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.2.3...v1.2.4) (2022-12-13) + + +### Bug Fixes + +* bump dependencies ([8183784](https://github.com/CoCreate-app/CoCreate-css-parser/commit/818378472b7eacf0622d80e80171179b8d3b0d50)) + +## [1.2.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.2.2...v1.2.3) (2022-12-12) + + +### Bug Fixes + +* bump dependencies ([924a130](https://github.com/CoCreate-app/CoCreate-css-parser/commit/924a13004eb6e2dccc85f86386afb21cdb0e08b1)) + +## [1.2.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.2.1...v1.2.2) (2022-12-11) + + +### Bug Fixes + +* bump dependencies ([e4ade8d](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e4ade8d2501399aeeeef5245d51916923fd9091c)) + +## [1.2.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.2.0...v1.2.1) (2022-12-09) + + +### Bug Fixes + +* bump dependencies ([e72de02](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e72de028e4e5b53e840cfed33e5725f9a9dd4c03)) + +# [1.2.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.13...v1.2.0) (2022-12-09) + + +### Features + +* set cssParser true or false from localStorage ([3270345](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3270345dbc6731c53bda766734c57a4281f05c49)) + +## [1.1.13](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.12...v1.1.13) (2022-12-09) + + +### Bug Fixes + +* typo getAttribute save was not a string ([811913e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/811913e4ff22501c00f809e559e6946a1728ca71)) + +## [1.1.12](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.11...v1.1.12) (2022-12-08) + + +### Bug Fixes + +* bump dependencies ([bb33d21](https://github.com/CoCreate-app/CoCreate-css-parser/commit/bb33d217581654723faafba63cd13c6b45242f83)) + +## [1.1.11](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.10...v1.1.11) (2022-12-07) + + +### Bug Fixes + +* bump dependencies ([7a7b5bb](https://github.com/CoCreate-app/CoCreate-css-parser/commit/7a7b5bbac229e5ee3c5c9fe74613cb6fa269ce6e)) + +## [1.1.10](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.9...v1.1.10) (2022-12-04) + + +### Bug Fixes + +* bump dependencies ([a70f719](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a70f719e506637e3f9377a7706460b148289e666)) +* improve parse and save attribute ([e8ca38e](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e8ca38ebd02cbe2ed9695fd64d8c7be46ef037eb)) + +## [1.1.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.8...v1.1.9) (2022-12-02) + + +### Bug Fixes + +* docs ([c8d13fb](https://github.com/CoCreate-app/CoCreate-css-parser/commit/c8d13fba172c9be3f17e5dea121ca66db8fd2d8b)) + +## [1.1.8](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.7...v1.1.8) (2022-12-02) + + +### Bug Fixes + +* bump dependencies ([bd3d05a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/bd3d05ab6f8f298ad4ebfacbd6d43a68a6572e4c)) + +## [1.1.7](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.6...v1.1.7) (2022-11-28) + + +### Bug Fixes + +* bump dependencies ([7da179a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/7da179aad14cdd4707d30a268491db689be21a48)) + +## [1.1.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.5...v1.1.6) (2022-11-28) + + +### Bug Fixes + +* bump dependencies ([6e49b70](https://github.com/CoCreate-app/CoCreate-css-parser/commit/6e49b7055cf376492119cb0aa23ad67d8525643f)) + +## [1.1.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.4...v1.1.5) (2022-11-27) + + +### Bug Fixes + +* bump dependencies ([ecb7407](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ecb7407f44b789fd6fb0b15ef192093eac6ef411)) + +## [1.1.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.3...v1.1.4) (2022-11-26) + + +### Bug Fixes + +* bump dependencies ([607564a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/607564a32fd8fb4493ba257fc958a930cd571021)) + +## [1.1.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.2...v1.1.3) (2022-11-25) + + +### Bug Fixes + +* bump dependencies ([200c48c](https://github.com/CoCreate-app/CoCreate-css-parser/commit/200c48cd2653fcb8606e79466bf5c849ef1ed97b)) +* CoCreate.crud.default removed bug causing default object ([2dec74d](https://github.com/CoCreate-app/CoCreate-css-parser/commit/2dec74d6785141b7c151644a0b935f14a4462666)) + +## [1.1.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.1...v1.1.2) (2022-11-24) + + +### Bug Fixes + +* bump depenedencies ([644c182](https://github.com/CoCreate-app/CoCreate-css-parser/commit/644c182233492c05188fa53ed30b29c7784fb611)) + +## [1.1.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.1.0...v1.1.1) (2022-11-23) + + +### Bug Fixes + +* bumped [@cocreate](https://github.com/cocreate) dependencies ([01efc5f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/01efc5f2d063ccaa1766cce4b8b33f7901d8f3d7)) + +# [1.1.0](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.17...v1.1.0) (2022-11-23) + + +### Features + +* link tag styles will only save if a document_id is defined ([e8083c3](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e8083c320e835e79bd26deaccce9fbb4fd2f20ca)) + +## [1.0.17](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.16...v1.0.17) (2022-11-22) + + +### Bug Fixes + +* apply src: {{source}} to CoCreate.config ([a2b9951](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a2b99514f79a9b15e7677624a7b0c1b8090e0bb6)) +* workflow docs ([43ff1d3](https://github.com/CoCreate-app/CoCreate-css-parser/commit/43ff1d35df091a379c3c0da3933a002ff7547396)) + +## [1.0.16](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.15...v1.0.16) (2022-11-21) + + +### Bug Fixes + +* @cocreate/docs bug fix ([cd90d54](https://github.com/CoCreate-app/CoCreate-css-parser/commit/cd90d54aca41562af32a98865506cdae8a0d3838)) + +## [1.0.15](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.14...v1.0.15) (2022-11-21) + + +### Bug Fixes + +* replaced document_id with document._id ([876684f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/876684f2a2d74f3a4bdd7a1dfaa30b37cd61b39e)) + +## [1.0.14](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.13...v1.0.14) (2022-11-21) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies ([d9167fc](https://github.com/CoCreate-app/CoCreate-css-parser/commit/d9167fc39013800c76e558421cd3e718bab7cf1c)) + +## [1.0.13](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.12...v1.0.13) (2022-11-21) + + +### Bug Fixes + +* bump d@cocreate ependencies ([f287dba](https://github.com/CoCreate-app/CoCreate-css-parser/commit/f287dba574bf46fdffdd1f00df454739082d8363)) + +## [1.0.12](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.11...v1.0.12) (2022-11-21) + + +### Bug Fixes + +* if linkTag parse css ([8f5e368](https://github.com/CoCreate-app/CoCreate-css-parser/commit/8f5e36821c0d18fba948d2c2e4ed0f8ae6462fe8)) +* update crud functions to receive an array of objects as the response ([6edb672](https://github.com/CoCreate-app/CoCreate-css-parser/commit/6edb672978200a146b1cad8e3a697ba91fdbf0ab)) + +## [1.0.11](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.10...v1.0.11) (2022-10-02) + + +### Bug Fixes + +* minor bug fixes ([632491d](https://github.com/CoCreate-app/CoCreate-css-parser/commit/632491d18135eb3ea6b10e51e090b9ab0871dda9)) + +## [1.0.10](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.9...v1.0.10) (2022-10-02) + + +### Bug Fixes + +* bump @cocreate/hosting and @cocreate/socket-client ([3f41bc9](https://github.com/CoCreate-app/CoCreate-css-parser/commit/3f41bc93dc7b96c5a8a6e73f55eef82a367f1514)) + +## [1.0.9](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.8...v1.0.9) (2022-10-01) + + +### Bug Fixes + +* bump dependencies ([cacf527](https://github.com/CoCreate-app/CoCreate-css-parser/commit/cacf527a04427476726ddbf0724f6a80b87725bd)) +* CoCreate.cssParser global scope ([a10d581](https://github.com/CoCreate-app/CoCreate-css-parser/commit/a10d581e45f84e1e96cd8b58c4d20a68e9b6e6de)) + +## [1.0.8](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.7...v1.0.8) (2022-09-30) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies ([674a62f](https://github.com/CoCreate-app/CoCreate-css-parser/commit/674a62f1c15b298225f4d3d0569d4cb2b6bff577)) + +## [1.0.7](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.6...v1.0.7) (2022-09-30) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies ([9ebdb31](https://github.com/CoCreate-app/CoCreate-css-parser/commit/9ebdb311561f0c4d4c9b07c12a1af765ab5d11e0)) + +## [1.0.6](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.5...v1.0.6) (2022-09-30) + + +### Bug Fixes + +* bump [@cocreate](https://github.com/cocreate) dependencies ([eaf3f5c](https://github.com/CoCreate-app/CoCreate-css-parser/commit/eaf3f5ceb4bb98816c5ec81b44e2d3cd8e3f908f)) + +## [1.0.5](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.4...v1.0.5) (2022-09-30) + + +### Bug Fixes + +* bump dependencies ([333a21a](https://github.com/CoCreate-app/CoCreate-css-parser/commit/333a21a1f94ba0cc36d21a93e12fe5091307c689)) + +## [1.0.4](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.3...v1.0.4) (2022-09-29) + + +### Bug Fixes + +* config renameed to CoCreateConfig ([25c9442](https://github.com/CoCreate-app/CoCreate-css-parser/commit/25c9442d089de8331e218b3ebbeac7904d6bac54)) + +## [1.0.3](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.2...v1.0.3) (2022-09-22) + + +### Bug Fixes + +* bumped dependencies ([20ded50](https://github.com/CoCreate-app/CoCreate-css-parser/commit/20ded50cae017ad84a9ac9570d5a31cf86cb0dba)) + +## [1.0.2](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.1...v1.0.2) (2022-09-01) + + +### Bug Fixes + +* bump all of [@cocreate](https://github.com/cocreate) dependencies ([e3166f7](https://github.com/CoCreate-app/CoCreate-css-parser/commit/e3166f719d7a27255a838748652f53f8e82581be)) + +## [1.0.1](https://github.com/CoCreate-app/CoCreate-css-parser/compare/v1.0.0...v1.0.1) (2022-07-31) + + +### Bug Fixes + +* update readme ([ad98442](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ad984428d2ef0d8ac9303e4c760cf79c941023d5)) + +# 1.0.0 (2022-07-31) + + +### Features + * Initial Release ([ca7ee93](https://github.com/CoCreate-app/CoCreate-css-parser/commit/ca7ee939d26408b2e8fe11f5073c93d56fe832e0)) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6120363..b7d16f7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,97 +1,97 @@ -# Contributing to CoCreate-css-parser - -This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-css-parser/graphs/contributors). -You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-css-parser/pulls), -[propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-css-parser/issues). - -In the examples below, substitute your Github username for `contributor` in URLs. - -## Fork the Project - -Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-css-parser) and check out your copy. - -``` -git clone https://github.com/contributor/CoCreate-css-parser.git -cd CoCreate-css-parser -git remote add upstream https://github.com/CoCreate-app/CoCreate-css-parser.git -``` - -## Create a Topic Branch - -Make sure your fork is up-to-date and create a topic branch for your feature or bug fix on dev branch. - -``` -git checkout dev -git pull upstream dev -git checkout -b my-feature-branch -``` - -## Write Tests - -Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. - -We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix. - -## Write Code - -Implement your feature or bug fix. - -## Write Documentation - -Document any external behavior in the [README](README.md). - -## Commit Changes - -Make sure git knows your name and email address: - -``` -git config --global user.name "Your Name" -git config --global user.email "contributor@example.com" -``` - -We use [semantic-release](https://github.com/semantic-release/semantic-release) as process to generate changelog -and to release. Write meaningful commits according to -[Commit Message Formats](https://github.com/semantic-release/semantic-release#commit-message-format) is important. - -``` -git add ... -git commit -am "commit-type(optional topic): a meaningful message" -``` - -Here is an example of the release type that should be done based on a [semantic-release](https://github.com/semantic-release/semantic-release): - -| Commit message | Release type | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- | -| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release | -| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release | -| `perf(pencil): remove graphiteWidth option`

`BREAKING CHANGE: The graphiteWidth option has been removed.`
`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release | - - -## Push - -``` -git push origin my-feature-branch -``` - -## Make a Pull Request - -Go to [https://github.com/CoCreate-app/CoCreate-css-parser](https://github.com/CoCreate-app/CoCreate-css-parser) and select your feature branch. -Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days. - -## Rebase - -If you've been working on a change for a while, rebase with upstream/dev. - -``` -git fetch upstream -git rebase upstream/dev -git push origin my-feature-branch -f -``` - -## Be Patient - -It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang in there! - -## Thank You - +# Contributing to CoCreate-css-parser + +This project is work of [many contributors](https://github.com/CoCreate-app/CoCreate-css-parser/graphs/contributors). +You're encouraged to submit [pull requests](https://github.com/CoCreate-app/CoCreate-css-parser/pulls), +[propose features and discuss issues](https://github.com/CoCreate-app/CoCreate-css-parser/issues). + +In the examples below, substitute your Github username for `contributor` in URLs. + +## Fork the Project + +Fork the [project on Github](https://github.com/CoCreate-app/CoCreate-css-parser) and check out your copy. + +``` +git clone https://github.com/contributor/CoCreate-css-parser.git +cd CoCreate-css-parser +git remote add upstream https://github.com/CoCreate-app/CoCreate-css-parser.git +``` + +## Create a Topic Branch + +Make sure your fork is up-to-date and create a topic branch for your feature or bug fix on dev branch. + +``` +git checkout dev +git pull upstream dev +git checkout -b my-feature-branch +``` + +## Write Tests + +Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. + +We definitely appreciate pull requests that highlight or reproduce a problem, even without a fix. + +## Write Code + +Implement your feature or bug fix. + +## Write Documentation + +Document any external behavior in the [README](README.md). + +## Commit Changes + +Make sure git knows your name and email address: + +``` +git config --global user.name "Your Name" +git config --global user.email "contributor@example.com" +``` + +We use [semantic-release](https://github.com/semantic-release/semantic-release) as process to generate changelog +and to release. Write meaningful commits according to +[Commit Message Formats](https://github.com/semantic-release/semantic-release#commit-message-format) is important. + +``` +git add ... +git commit -am "commit-type(optional topic): a meaningful message" +``` + +Here is an example of the release type that should be done based on a [semantic-release](https://github.com/semantic-release/semantic-release): + +| Commit message | Release type | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- | +| `fix(pencil): stop graphite breaking when too much pressure applied` | Patch Release | +| `feat(pencil): add 'graphiteWidth' option` | ~~Minor~~ Feature Release | +| `perf(pencil): remove graphiteWidth option`

`BREAKING CHANGE: The graphiteWidth option has been removed.`
`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release | + + +## Push + +``` +git push origin my-feature-branch +``` + +## Make a Pull Request + +Go to [https://github.com/CoCreate-app/CoCreate-css-parser](https://github.com/CoCreate-app/CoCreate-css-parser) and select your feature branch. +Click the 'Pull Request' button and fill out the form. Pull requests are usually reviewed within a few days. + +## Rebase + +If you've been working on a change for a while, rebase with upstream/dev. + +``` +git fetch upstream +git rebase upstream/dev +git push origin my-feature-branch -f +``` + +## Be Patient + +It's likely that your change will not be merged and that the nitpicky maintainers will ask you to do more, or fix seemingly benign problems. Hang in there! + +## Thank You + Please do know that we really appreciate and value your time and work. We love you, really. \ No newline at end of file diff --git a/CoCreate.config.js b/CoCreate.config.js index be0cd84..2ff2abe 100644 --- a/CoCreate.config.js +++ b/CoCreate.config.js @@ -1,43 +1,24 @@ module.exports = { - "config": { - "apiKey": "2061acef-0451-4545-f754-60cf8160", - "organization_Id": "5ff747727005da1c272740ab", - "host": "general.cocreate.app" - }, - - "sources": [{ - "entry": "./docs/index.html", - "collection": "files", - "document_id": "60145dc49f64ba1680b86693", - "key": "src", - "data":{ + "organization_id": "", + "key": "", + "host": "", + "sources": [ + { + "array": "files", + "object": { + "_id": "637ca39950234ef1671ce312", "name": "index.html", - "path": "/docs/css-parser/index.html", - "domains": [ + "path": "/docs/css-parser", + "pathname": "/docs/css-parser/index.html", + "src": "{{./docs/index.html}}", + "host": [ "cocreate.app", "general.cocreate.app" ], - "directory": "/docs/css-parser", - "content-type": "text/html", - "public": "true", - "website_id": "5ffbceb7f11d2d00103c4535" + "directory": "css-parser", + "content-type": "{{content-type}}", + "public": "true" } } - ], - - "extract": { - "directory": "./src/", - "extensions": [ - "js", - "css", - "html" - ], - "ignores": [ - "node_modules", - "vendor", - "bower_components", - "archive" - ] - } -} - + ] +}; \ No newline at end of file diff --git a/LICENSE b/LICENSE index 9b8cc63..799de9e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2021 CoCreate LLC - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2021 CoCreate LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index da4aa34..e6c051d 100644 --- a/README.md +++ b/README.md @@ -1,84 +1,84 @@ -# CoCreate-css-parser - -A simple css-parser component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/css-parser) - -![min file size in bytes](https://img.badgesize.io/https://cdn.cocreate.app/css-parser/latest/CoCreate-css-parser.min.js?style=flat-square&label=minified&color=orange) -![gzip file size in bytes](https://img.badgesize.io/https://cdn.cocreate.app/css-parser/latest/CoCreate-css-parser.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow) -![brotlifile size in bytes](https://img.badgesize.io/https://cdn.cocreate.app/css-parser/latest/CoCreate-css-parser.min.js?compression=brotli&style=flat-square&label=brotli) -![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-css-parser?style=flat-square) -![GitHub](https://img.shields.io/github/license/CoCreate-app/CoCreate-css-parser?style=flat-square) -![GitHub](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet) - - -![CoCreate-css-parser](https://cdn.cocreate.app/docs/CoCreate-css-parser.gif) - -## [Docs & Demo](https://cocreate.app/docs/css-parser) - -For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/css-parser) - -## CDN - -```html - -``` - -```html - -``` - -## NPM - -```shell -$ npm i @cocreate/css-parser -``` - -## yarn - -```shell -$ yarn install @cocreate/css-parser -``` - -# Table of Contents - -- [Table of Contents](#table-of-contents) -- [Announcements](#announcements) -- [Roadmap](#roadmap) -- [How to Contribute](#how-to-contribute) -- [About](#about) -- [License](#license) - - - -# Announcements - -All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-css-parser/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-css-parser/releases). You may also subscribe to email for releases and breaking changes. - - - -# Roadmap - -If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-css-parser/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-css-parser/pulls). We would love to hear your feedback. - - - -# About - -CoCreate-css-parser is guided and supported by the CoCreate Developer Experience Team. - -Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries. - -CoCreate-css-parser is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC. - - - -# How to Contribute - -We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-css-parser/blob/master/CONTRIBUTING.md) guide for details. - -We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-css-parser/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-css-parser/pulls) or merely upvote or comment on existing issues or pull requests. - -We appreciate your continued support, thank you! - -# License - -[The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-css-parser/blob/master/LICENSE) +# CoCreate-css-parser + +A simple css-parser component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API. Take it for a spin in our [playground!](https://cocreate.app/docs/css-parser) + +![min file size in bytes](https://img.badgesize.io/https://cdn.cocreate.app/css-parser/latest/CoCreate-css-parser.min.js?style=flat-square&label=minified&color=orange) +![gzip file size in bytes](https://img.badgesize.io/https://cdn.cocreate.app/css-parser/latest/CoCreate-css-parser.min.js?compression=gzip&style=flat-square&label=gzip&color=yellow) +![brotlifile size in bytes](https://img.badgesize.io/https://cdn.cocreate.app/css-parser/latest/CoCreate-css-parser.min.js?compression=brotli&style=flat-square&label=brotli) +![GitHub latest release](https://img.shields.io/github/v/release/CoCreate-app/CoCreate-css-parser?style=flat-square) +![GitHub](https://img.shields.io/github/license/CoCreate-app/CoCreate-css-parser?style=flat-square) +![GitHub](https://img.shields.io/static/v1?style=flat-square&label=&message=Hiring&color=blueviolet) + + +![CoCreate-css-parser](https://cdn.cocreate.app/docs/CoCreate-css-parser.gif) + +## [Docs & Demo](https://cocreate.app/docs/css-parser) + +For a complete guide and working demo refer to the [doumentation](https://cocreate.app/docs/css-parser) + +## CDN + +```html + +``` + +```html + +``` + +## NPM + +```shell +$ npm i @cocreate/css-parser +``` + +## yarn + +```shell +$ yarn install @cocreate/css-parser +``` + +# Table of Contents + +- [Table of Contents](#table-of-contents) +- [Announcements](#announcements) +- [Roadmap](#roadmap) +- [How to Contribute](#how-to-contribute) +- [About](#about) +- [License](#license) + + + +# Announcements + +All updates to this library are documented in our [CHANGELOG](https://github.com/CoCreate-app/CoCreate-css-parser/blob/master/CHANGELOG.md) and [releases](https://github.com/CoCreate-app/CoCreate-css-parser/releases). You may also subscribe to email for releases and breaking changes. + + + +# Roadmap + +If you are interested in the future direction of this project, please take a look at our open [issues](https://github.com/CoCreate-app/CoCreate-css-parser/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-css-parser/pulls). We would love to hear your feedback. + + + +# About + +CoCreate-css-parser is guided and supported by the CoCreate Developer Experience Team. + +Please Email the Developer Experience Team [here](mailto:develop@cocreate.app) in case of any queries. + +CoCreate-css-parser is maintained and funded by CoCreate. The names and logos for CoCreate are trademarks of CoCreate, LLC. + + + +# How to Contribute + +We encourage contribution to our libraries (you might even score some nifty swag), please see our [CONTRIBUTING](https://github.com/CoCreate-app/CoCreate-css-parser/blob/master/CONTRIBUTING.md) guide for details. + +We want this library to be community-driven, and CoCreate led. We need your help to realize this goal. To help make sure we are building the right things in the right order, we ask that you create [issues](https://github.com/CoCreate-app/CoCreate-css-parser/issues) and [pull requests](https://github.com/CoCreate-app/CoCreate-css-parser/pulls) or merely upvote or comment on existing issues or pull requests. + +We appreciate your continued support, thank you! + +# License + +[The MIT License (MIT)](https://github.com/CoCreate-app/CoCreate-css-parser/blob/master/LICENSE) diff --git a/demo/atomic-css.html b/demo/atomic-css.html index b01cb9c..8fc55ea 100644 --- a/demo/atomic-css.html +++ b/demo/atomic-css.html @@ -1,815 +1,1109 @@ - - - - - - - CoCreate-atomic-css Documentation | CoCreateCSS - - - - - - - - - - - - - -
-
-
-

CoCreate helper CSS

-
-
- - - - - -
-
-

CoCreate provides the most convenient helper class.

-
-
-
- -

Reference

- -
-
- -
-

CoCreate Helper Classes are very easy to use.

-

We can use exactly same class names with "style:value".

-
-
-                                
-<div class="padding:16px"></div>
-<div class="font-size:0.5rem color:red"></div>
-                                
-                            
-
-

Main styles and values provided as helper classes are as follows.

-
-
-
- -
-

direction

-
-
<div class="direction:ltr"></div>
-

ltr

-

rtl

-
-

display

-
-
<div class="display:block"></div>
-

block

-

inline-block

-

inline

-

none

-

inherit

-

table

-

table-cell

-

flex

-
-

overflow

-
-
<div class="overflow:auto"></div>
-

auto

-

visible

-

scroll

-

hidden

-
-

float

-
-
<div class="float:left"></div>
-

left

-

right

-

none

-
-

position

-
-
<div class="position:relative"></div>
-

inherit

-

relative

-

absolute

-

fixed

-

sticky

-
-

z-index

-
-
<div class="z-index:auto"></div>
-

auto

-

inherit

-

initial

-

-2

-

-5

-

1 ~ 15

-

100

-

101

-

111

-

1000

-

1111

-
-

top / bottom / left / right

-
-
<div class="top:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

bottom

-
-
<div class="bottom:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

left

-
-
<div class="left:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

right

-
-
<div class="right:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

height

-
-
<div class="height:0"></div>
-

0

-

1px ~ 10px

-

20px

-

30px

-

40px

-

45px

-

48px

-

50px

-

70px

-

80px

-

90px

-

100px

-

130px

-

150px

-

200px

-

250px

-

300px

-

350px

-

...

-

700px

-

auto

-

25%

-

33%

-

50%

-

66%

-

75%

-

100%

-

100%-120px

-

100vh-120px

-

100vh-100px

-

100vh-90px

-

100vh-70px

-

100vh-50px

-

80vh

-

90vh

-

100vh

-

fill-available

-

fit-content

-
-

min-height

-
-
<div class="min-height:100px"></div>
-

100px

-

200px

-

...

-

700px

-
-

max-height

-
-
<div class="max-height:300px"></div>
-

60px

-

100%

-
-

width

-
-
<div class="width:0"></div>
-

0

-

1px ~ 10px

-

15px

-

20px

-

25px

-

...

-

90px

-

100px

-

110px

-

120px

-

130px

-

150px

-

180px

-

200px

-

250px

-

300px

-

350px

-

...

-

1000px

-

10%

-

12%

-

15%

-

20%

-

25%

-

30%

-

35%

-

40%

-

41% ~ 50%

-

55%

-

60%

-

65%

-

70%

-

75%

-

80%

-

85%

-

90%

-

95%

-

100%

-

auto

-

unset

-

fill-available

-
-

min-width

-
-
<div class="min-width:75px"></div>
-

75px

-

100px

-

200px

-

250px

-

300px

-
-

max-width

-
-
<div class="max-width:300px"></div>
-

75px

-

100px

-

300px

-

400px

-

500px

-

600px

-

1050px

-
-

margin

-
-
<div class="margin:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-

auto-lr(left & right)

-

0-lr

-

5px-lr

-

10px-lr

-

15px-lr

-

...

-

100px-lr

-

auto-tb(top & bottom)

-

0-tb

-

5px_0px

-

10px_0px

-

15px_0px

-

...

-

100px_0px

-
-

margin-top

-
-
<div class="margin=top:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

margin-bottom

-
-
<div class="margin-bottom:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

margin-left

-
-
<div class="margin-left:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

margin-right

-
-
<div class="margin-right:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding

-
-
<div class="padding:0"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-

0-tb(top & bottom)

-

5px_0px

-

10px_0px

-

15px_0px

-

...

-

100px_0px

-

0-lr(left & right)

-

1px-lr ~ 15px-lr

-

20px-lr

-

25px-lr

-

30px-lr

-

...

-

100px-lr

-
-

padding-top

-
-
<div class="padding-top:0"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding-bottom

-
-
<div class="padding-bottom:15px"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding-left

-
-
<div class="padding-left:15px"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding-right

-
-
<div class="padding-right:15px"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

border-width

-
-
<div class="border-width:0"></div>
-

0

-

1px ~ 10px

-

20px

-
-

border-color

-
-
<div class="border-color:black"></div>
-

white

-

black

-

extra-dark-gray

-

medium-dark-gray

-

dark-gray

-

extra-medium-gray

-

medium-gray

-

extra-light-gray

-

light-gray

-

light-pink

-

deep-pink

-

transparent-pink

-
-

border-style

-
-
<div class="border-style:dotted"></div>
-

dotted

-

dashed

-

solid

-

double

-

groove

-

ridge

-

inset

-

outset

-

none

-

hidden

-

transparent

-
-

border-radius

-
-
<div class="border-radius:0"></div>
-

0

-

1px ~ 10px

-

50px

-

50%

-

100%

-
-

font-size

-
-
<div class="font-size:18px"></div>
-

6px ~ 25px

-

30px

-

40px

-

50px

-

...

-

80px

-

01rem

-

02rem

-

03rem

-

04rem

-

05rem

-

1rem

-

2rem

-
-

font-weight

-
-
<div class="font-weight:800"></div>
-

100

-

200

-

300

-

...

-

900

-

bold

-
-

font-align

-
-
<div class="font-align:center"></div>
-

center

-

left

-

right

-
-

color

-
-
<div class="color:blue"></div>
-

white

-

black

-

extra-dark-gray

-

dark-gray

-

extra-medium-gray

-

medium-gray

-

extra-light-gray

-

light-gray

-

light-gray

-

very-light-gray

-

deep-pink

-

light-blue

-

blue

-
-

text-overflow

-
-
<div class="text-overflow:ellipsis"></div>
-

ellipsis

-
-

text-transform

-
-
<div class="text-transform:uppercase"></div>
-

uppercase

-
-

text-decoration

-
-
<div class="text-decoration:underline"></div>
-

underline

-
-

background-attachment

-
-
<div class="background-attachment:scroll"></div>
-

scroll

-

fixed

-

local

-

initial

-

inherit

-
-

background-repeat

-
-
<div class="background-repeat:repeat"></div>
-

repeat

-

repeat-x

-

repeat-y

-

no-repeat

-

initial

-

inherit

-
-

background-size

-
-
<div class="background-size:auto"></div>
-

auto

-

cover

-

contain

-

initial

-

inherit

-
-

background-position

-
-
<div class="background-position:center"></div>
-

left-top

-

left-center

-

left-bottom

-

right-top

-

right-center

-

right-bottom

-

center

-

center-top

-

center-center

-

center-bottom

-

initial

-

inherit

-
-

bg (background)

-
-
<div class="background:blue"></div>
-

transparent

-

white

-

black

-

dark-blue

-

extra-dark-gray

-

dark-gray

-

extra-medium-gray

-

medium-gray

-

extra-light-gray

-

medium-light-gray

-

light-gray

-

very-light-gray

-

deep-pink

-

transparent-white

-

transparent-black

-

white-opacity

-

black-opacity

-

black-opacity-light

-

deep-pink-opacity

-

charcoal-gray

-

blue

-
-

background

-
-
<div class="background:black"></div>
-

transparent

-

white

-

black

-

dark-blue

-
-

opacity

-
-
<div class="opacity:block"></div>
-

0

-

0.1

-

0.2

-

0.3

-

...

-

0.9

-

1

-
-

cursor

-
-
<div class="cursor:auto"></div>
-

alias

-

all-scroll

-

auto

-

cell

-

context-menu

-

col-resize

-

copy

-

crosshair

-

default

-

e-resize

-

ew-resize

-

grab

-

grabbing

-

help

-

move

-

n-resize

-

ne-resize

-

nesw-resize

-

ns-resize

-

nw-resize

-

nwse-resize

-

no-drop

-

none

-

not-allowed

-

pointer

-

progress

-

row-resize

-

s-resize

-

se-resize

-

sw-resize

-

text

-

url

-

w-resize

-

wait

-

zoom-in

-

zoom-out

-
-
-
- -
- - -
- -

Demo

- -
-
-
-
-
- - - - - - - -
- -
- -
- -
-
-
-
-
- -
- -
- -
-
-
- -
-
-
-
- - - - - - - - - - - - - \ No newline at end of file + + + + + + + CoCreate-atomic-css Documentation | CoCreateCSS + + + + + + + + + + + + +
+
+
+

CoCreate helper CSS

+
+
+ + + + + +
+
+

+ CoCreate provides the most convenient helper class. +

+
+
+
+ +

Reference

+ +
+
+ +
+

+ CoCreate Helper Classes are very easy to use. +

+

+ We can use exactly same class names with + "style:value". +

+
+
+                                
+<div class="padding:16px"></div>
+<div class="font-size:0.5rem color:red"></div>
+                                
+                            
+
+

+ Main styles and values provided as helper classes + are as follows. +

+
+
+
+ +
+

+ direction +

+
+
<div class="direction:ltr"></div>
+

ltr

+

rtl

+
+

+ display +

+
+
<div class="display:block"></div>
+

block

+

inline-block

+

inline

+

none

+

inherit

+

table

+

table-cell

+

flex

+
+

+ overflow +

+
+
<div class="overflow:auto"></div>
+

auto

+

visible

+

scroll

+

hidden

+
+

+ float +

+
+
<div class="float:left"></div>
+

left

+

right

+

none

+
+

+ position +

+
+
<div class="position:relative"></div>
+

inherit

+

relative

+

absolute

+

fixed

+

sticky

+
+

+ z-index +

+
+
<div class="z-index:auto"></div>
+

auto

+

inherit

+

initial

+

-2

+

-5

+

1 ~ 15

+

100

+

101

+

111

+

1000

+

1111

+
+

+ top / bottom / left / right +

+
+
<div class="top:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ bottom +

+
+
<div class="bottom:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ left +

+
+
<div class="left:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ right +

+
+
<div class="right:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ height +

+
+
<div class="height:0"></div>
+

0

+

1px ~ 10px

+

20px

+

30px

+

40px

+

45px

+

48px

+

50px

+

70px

+

80px

+

90px

+

100px

+

130px

+

150px

+

200px

+

250px

+

300px

+

350px

+

...

+

700px

+

auto

+

25%

+

33%

+

50%

+

66%

+

75%

+

100%

+

100%-120px

+

100vh-120px

+

100vh-100px

+

100vh-90px

+

100vh-70px

+

100vh-50px

+

80vh

+

90vh

+

100vh

+

fill-available

+

fit-content

+
+

+ min-height +

+
+
<div class="min-height:100px"></div>
+

100px

+

200px

+

...

+

700px

+
+

+ max-height +

+
+
<div class="max-height:300px"></div>
+

60px

+

100%

+
+

+ width +

+
+
<div class="width:0"></div>
+

0

+

1px ~ 10px

+

15px

+

20px

+

25px

+

...

+

90px

+

100px

+

110px

+

120px

+

130px

+

150px

+

180px

+

200px

+

250px

+

300px

+

350px

+

...

+

1000px

+

10%

+

12%

+

15%

+

20%

+

25%

+

30%

+

35%

+

40%

+

41% ~ 50%

+

55%

+

60%

+

65%

+

70%

+

75%

+

80%

+

85%

+

90%

+

95%

+

100%

+

auto

+

unset

+

fill-available

+
+

+ min-width +

+
+
<div class="min-width:75px"></div>
+

75px

+

100px

+

200px

+

250px

+

300px

+
+

+ max-width +

+
+
<div class="max-width:300px"></div>
+

75px

+

100px

+

300px

+

400px

+

500px

+

600px

+

1050px

+
+

+ margin +

+
+
<div class="margin:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+

+ auto-lr(left & right) +

+

0-lr

+

5px-lr

+

10px-lr

+

15px-lr

+

...

+

100px-lr

+

+ auto-tb(top & bottom) +

+

0-tb

+

5px_0px

+

10px_0px

+

15px_0px

+

...

+

100px_0px

+
+

+ margin-top +

+
+
<div class="margin=top:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ margin-bottom +

+
+
<div class="margin-bottom:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ margin-left +

+
+
<div class="margin-left:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ margin-right +

+
+
<div class="margin-right:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding +

+
+
<div class="padding:0"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+

0-tb(top & bottom)

+

5px_0px

+

10px_0px

+

15px_0px

+

...

+

100px_0px

+

0-lr(left & right)

+

1px-lr ~ 15px-lr

+

20px-lr

+

25px-lr

+

30px-lr

+

...

+

100px-lr

+
+

+ padding-top +

+
+
<div class="padding-top:0"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding-bottom +

+
+
<div class="padding-bottom:15px"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding-left +

+
+
<div class="padding-left:15px"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding-right +

+
+
<div class="padding-right:15px"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ border-width +

+
+
<div class="border-width:0"></div>
+

0

+

1px ~ 10px

+

20px

+
+

+ border-color +

+
+
<div class="border-color:black"></div>
+

white

+

black

+

extra-dark-gray

+

medium-dark-gray

+

dark-gray

+

extra-medium-gray

+

medium-gray

+

extra-light-gray

+

light-gray

+

light-pink

+

deep-pink

+

transparent-pink

+
+

+ border-style +

+
+
<div class="border-style:dotted"></div>
+

dotted

+

dashed

+

solid

+

double

+

groove

+

ridge

+

inset

+

outset

+

none

+

hidden

+

transparent

+
+

+ border-radius +

+
+
<div class="border-radius:0"></div>
+

0

+

1px ~ 10px

+

50px

+

50%

+

100%

+
+

+ font-size +

+
+
<div class="font-size:18px"></div>
+

6px ~ 25px

+

30px

+

40px

+

50px

+

...

+

80px

+

01rem

+

02rem

+

03rem

+

04rem

+

05rem

+

1rem

+

2rem

+
+

+ font-weight +

+
+
<div class="font-weight:800"></div>
+

100

+

200

+

300

+

...

+

900

+

bold

+
+

+ font-align +

+
+
<div class="font-align:center"></div>
+

center

+

left

+

right

+
+

+ color +

+
+
<div class="color:blue"></div>
+

white

+

black

+

extra-dark-gray

+

dark-gray

+

extra-medium-gray

+

medium-gray

+

extra-light-gray

+

light-gray

+

light-gray

+

very-light-gray

+

deep-pink

+

light-blue

+

blue

+
+

+ text-overflow +

+
+
<div class="text-overflow:ellipsis"></div>
+

ellipsis

+
+

+ text-transform +

+
+
<div class="text-transform:uppercase"></div>
+

uppercase

+
+

+ text-decoration +

+
+
<div class="text-decoration:underline"></div>
+

underline

+
+

+ background-attachment +

+
+
<div class="background-attachment:scroll"></div>
+

scroll

+

fixed

+

local

+

initial

+

inherit

+
+

+ background-repeat +

+
+
<div class="background-repeat:repeat"></div>
+

repeat

+

repeat-x

+

repeat-y

+

no-repeat

+

initial

+

inherit

+
+

+ background-size +

+
+
<div class="background-size:auto"></div>
+

auto

+

cover

+

contain

+

initial

+

inherit

+
+

+ background-position +

+
+
<div class="background-position:center"></div>
+

left-top

+

left-center

+

left-bottom

+

right-top

+

right-center

+

right-bottom

+

center

+

center-top

+

center-center

+

center-bottom

+

initial

+

inherit

+
+

+ bg (background) +

+
+
<div class="background:blue"></div>
+

transparent

+

white

+

black

+

dark-blue

+

extra-dark-gray

+

dark-gray

+

extra-medium-gray

+

medium-gray

+

extra-light-gray

+

medium-light-gray

+

light-gray

+

very-light-gray

+

deep-pink

+

transparent-white

+

transparent-black

+

white-opacity

+

black-opacity

+

black-opacity-light

+

deep-pink-opacity

+

charcoal-gray

+

blue

+
+

+ background +

+
+
<div class="background:black"></div>
+

transparent

+

white

+

black

+

dark-blue

+
+

+ opacity +

+
+
<div class="opacity:block"></div>
+

0

+

0.1

+

0.2

+

0.3

+

...

+

0.9

+

1

+
+

+ cursor +

+
+
<div class="cursor:auto"></div>
+

alias

+

all-scroll

+

auto

+

cell

+

context-menu

+

col-resize

+

copy

+

crosshair

+

default

+

e-resize

+

ew-resize

+

grab

+

grabbing

+

help

+

move

+

n-resize

+

ne-resize

+

nesw-resize

+

ns-resize

+

nw-resize

+

nwse-resize

+

no-drop

+

none

+

not-allowed

+

pointer

+

progress

+

row-resize

+

s-resize

+

se-resize

+

sw-resize

+

text

+

url

+

w-resize

+

wait

+

zoom-in

+

zoom-out

+
+
+
+ +
+
+ +

Demo

+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+ + + + + +
+
+ +
+
+
+
+ + + + + + + + + + diff --git a/demo/index.html b/demo/index.html index 3d6520c..fe38611 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,28 +1,313 @@ - - - - - - - - - css-parser | CoCreateJS - - - - - - - - - - - - - + + + + + + + + css-parser | CoCreateJS + + + + + + + +
+

CoCreate CSS Parser Demo

+ +
+

Usage and Configuration

+

+ To use the CoCreate CSS Parser, include the CoCreate.js + script in your HTML file. You can configure its behavior by + adding attributes to the script tag. +

+
<script src="https://CoCreate.app/dist/CoCreate.js"></script>
+ +

Configuration Attributes

+ +

+ To enable saving, you must add a <link> + tag to your document. The parser will generate the CSS, and + CoCreate's backend will save it as a file. There are two + ways to configure this: +

+ +

1. Using the `name` attribute:

+

+ The simplest method is to add a <link> + tag with a name attribute. The value of the + name attribute will be used as the filename for the saved + CSS. +

+
<link name="styles.css" rel="stylesheet" type="text/css">
+ +

2. Using CoCreate CRUD attributes:

+

+ Alternatively, you can use CoCreate's standard storage + attributes to specify where to save the CSS content within + your database. +

+
<link array="files" object_id="some_unique_id" key="css" rel="stylesheet" type="text/css">
+ +

+ Example of disabling automatic parsing and saving on the + script tag: +

+
<script src="https://CoCreate.app/dist/CoCreate.js" parse="false" save="false"></script>
+
+ +
+

1. Basic Styling

+

+ You can apply any CSS declaration directly within the class + attribute. The syntax is a simple `property:value` format. + This allows you to "freehand" your styles without writing + separate CSS files. +

+

+ If a CSS value contains spaces, simply replace each space + with an underscore (`_`). For example, to apply + `border: 1px solid black`, you would write the class + `border:1px_solid_black`. +

+
+ This text is blue and 20px. +
+
+ This div has a border, padding, and a specific font family + using underscores for spaces in values. +
+
+ +
+

2. Breakpoint-based Styling

+

+ Use predefined breakpoints (xs, sm, md, lg, xl) to apply + styles at different screen sizes. Resize your browser to see + the effect. +

+
+ My background color changes based on screen width. +
+
+ +
+

3. Height-based Styling

+

+ Apply styles based on the viewport height using height-based + breakpoints (e.g., `h-xs`, `h-sm`, `h-md`). This is useful + for adjusting layouts when vertical space is limited. +

+
+ This has a khaki background when the viewport height is + within the "sm" range (576px-768px). +
+
+ +
+

4. Orientation-based Styling

+

+ Apply styles based on the device orientation (portrait or + landscape). +

+
+ This text is only visible and green in landscape mode. +
+
+ This text is only visible and purple in portrait mode. +
+
+ +
+

5. Color Scheme Preference (Dark/Light Mode)

+

+ Use `dark` or `light` to style elements based on the user's + system preference. +

+
+ My colors adapt to your system's light or dark mode. +
+
+ +
+

6. Print and Screen Media Types

+

+ Apply styles specifically for printing or for screen + display. +

+
+ This text will not appear when you print the page. +
+
+ This text is only visible on the printed page. +
+
+ +
+

7. Custom Media Queries

+

+ You can write your own media query conditions directly in + the class. +

+
+ This text turns red when the viewport is wider than 800px. +
+
+ This text is italic when the viewport is narrower than 600px. +
+
+ +
+

8. Combining Media Queries

+

+ Combine multiple conditions using `&`. This allows for + highly specific styling rules. +

+
+ This style applies only on small screens (sm) AND in dark + mode. +
+
+ This element gets a red border on medium-sized screens (md) + AND in landscape orientation. +
+
+ +
+

9. Using `OR` and `NOT` in Media Queries

+

+ The parser supports `OR` (using a comma `,`) and `NOT` + (using a `not_` prefix) logic in media queries. +

+
+ This text is purple on extra-small (xs) OR extra-large (xl) + screens. +
+
+ This text is hidden for all media types EXCEPT print. You + won't see it on the screen. +
+
+ This text is only visible on the printed page, proving the + `not_print` rule works. +
+
+ +
+

10. Using className for Reusable Styles

+

+ Group multiple atomic styles under a single reusable class + name using the `className` attribute. +

+
+ I'm a button. +
+
+ I'm the same button, but I turn green in dark mode. +
+
+
+

11. Using `!important`

+

+ You can make a style declaration `!important` to override + other conflicting styles. Just append `!important` to the + class definition. According to CSS rules, `!important` gives + a style the highest priority, overriding other styles + regardless of specificity or source order. +

+
+ This text will be red because the `!important` rule has + higher priority. +
+
+ On medium screens, this text will be purple because the + `!important` rule overrides the other media-queried style. +
+
+ +
+

12. Styling Pseudo-classes (e.g., :hover)

+

+ To style pseudo-classes like `:hover`, `:focus`, or + `:active`, define a style rule by attaching the + pseudo-class to the `className` attribute. This creates a + more specific CSS selector that applies during the specified + state (e.g., when hovering). You can also make these styles + `!important` to ensure they override any other conflicting + hover styles. +

+
+ Hover over me. +
+ +
+
+ +
+

13. Complex Combined Queries

+

+ You can chain multiple media features together to create + very specific styling conditions. This example applies a + style only on medium-sized screens, in landscape mode, AND + when the user has a dark color scheme preference. +

+
+ This style is visible only on medium screens in landscape + and dark mode. +
+
+ +
+

14. Advanced: Combining Pseudo-classes, Media Queries, and `!important`

+

+ You can combine pseudo-classes, media queries, and the + `!important` flag for highly specific and prioritized + styles. The parser handles the complexity of generating the + correct CSS rule, and the browser applies them based on + standard CSS precedence: `!important` wins first, then + selector specificity (a `:hover` selector is more specific), + then source order. +

+
+ Hover over me on a large screen. +
+ +
+
+
+ + diff --git a/demo/test.1.html b/demo/test.1.html index 5b7d00b..a59d485 100644 --- a/demo/test.1.html +++ b/demo/test.1.html @@ -1,46 +1,59 @@ - - - - - - - - CoCreateCSS - A utility first, atomic CSS framework - - - - - - - - - - -
-
-

hello how are you

-
-
-

hello how are you

-
- Toggle Darkmode -
-
- Toggle Darkmode -
- - - - - - - - - - \ No newline at end of file + + + + + + + CoCreateCSS - A utility first, atomic CSS framework + + + + + + + + + +
+
+

hello how are you

+
+
+

+ hello how are you +

+
+ Toggle Darkmode +
+
+ Toggle Darkmode +
+ + + + + diff --git a/demo/test.css b/demo/test.css index 1535300..59c32cd 100644 --- a/demo/test.css +++ b/demo/test.css @@ -1,27 +1,27 @@ -*{padding:0px; margin:0px;} - -*, *:before, *:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -html { - scroll-behavior: smooth; - } - -body { - background-color: #fff; - font-family: 'Open Sans', sans-serif; - font-size: 1rem; - color: #505050; - font-weight: 100; - -webkit-font-smoothing: antialiased; - -webkit-text-size-adjust: 100%; - } - -a { - text-decoration: none; - cursor: pointer; - align-items: center; - color: inherit; -} +*{padding:0px; margin:0px;} + +*, *:before, *:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + scroll-behavior: smooth; + } + +body { + background-color: #fff; + font-family: 'Open Sans', sans-serif; + font-size: 1rem; + color: #505050; + font-weight: 100; + -webkit-font-smoothing: antialiased; + -webkit-text-size-adjust: 100%; + } + +a { + text-decoration: none; + cursor: pointer; + align-items: center; + color: inherit; +} diff --git a/demo/test.html b/demo/test.html index c41c564..0d566a1 100644 --- a/demo/test.html +++ b/demo/test.html @@ -1,252 +1,444 @@ - - - - - - - - CoCreateCSS - A utility first, atomic CSS framework - - - - - - - - - - - - - - -
-
-

hello how are you

-
-
-

hello how are you

-
- Toggle Darkmode -
-
- Toggle Darkmode -
- - - - - - -
-
- - Modal Viewport/Boundaries - - - Main Content -
-
-
-
-
- -
-
hehehe
-
first one
-
and second one
-
-

A Utility First, Atomic CSS Framework

- For Building Collaborative Apps, Platforms and UI's -

HTML and CSS, No JS Required...

- -
-
-
-
- - COMPANY SECTION -
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
-
- - - Micro Component Architecture -
-
-
-
- -
-
-

Micro Component Architecture

-

Vanilla javascript, lightweight, single purpose micro components. Easily modify, remove and/or replace components. Highly configuarable using HTML5 attributes. HTML5 developers can use a combination of attributes to create - a dynamic experience. Javascript developers still have access to API, callbacks and events.

-

- Sign Up Now -
-
-
-
- - Collabrative Headless CMS -
-
-
-
- -
-
-

Collaborative Headless CMS

-

A lighting fast headless CMS over websocket, providing CRUD and CRDT functionality. Create, Read, Update, Delete and Filter lists. Collaborate on Text, DOM and Objects. Configure using HTML5 data-attibutes. Supports offline editing - and user cursor positions in Inputs, Textareas, Rich Text Editors and Code Editors. But of course... Javascript developers still have access to API, callbacks and events.

- Get Your API Key -
-
-
-
- - Fully Customizable Admin Panel -
-
-
-
- -
-
-

Fully Customizable Admin Panel

-

HTML5 Admin dashboard UI powered by CoCreateJS. It is 100% editable and used to manage and create views for your data and content. Use it as a Collaborative CRM, CMS and ERP. Can be modified, replaced or used as an example to build - your own custom HTML5 admin dashboard.

-

- Sign Up Now -
-
-
-
- - Collabrative Builder -
-
-
-
- -
-
-

Collaborative Drag-n-Drop Builder

-

We are in the process of using CoCreateJS components to create an experimental NO Code expereince. Every page of the adminUI can be edited in the drag and drop builder. CoCreate builder UI is completely customizable and supports - editing of any html5 template. Can be modified, replaced or used as an example to build your own custom drang and drop builder.

-
-
-
-
- - Thirdparty API Intergration -
-
-
-
- -
-
-

Thirdparty API Intergration

-

We have put together a few thirdparty APIs and developed them to be used and configured with HTML5 attributes. Build custom flows and logic without ever leaving the html page... The CoCreate Way... Almost forgot, Javascript - developers still have access to API, callbacks and events.

-

- Sign Up Now -
-
-
-
- - -
- - Footer - - - - - - - - - - - \ No newline at end of file + + + + + + + CoCreateCSS - A utility first, atomic CSS framework + + + + + + + + + + + + +
+
+

hello how are you

+
+
+

+ hello how are you +

+
+ Toggle Darkmode +
+
+ Toggle Darkmode +
+ + + + +
+
+ + Modal Viewport/Boundaries + + + Main Content +
+
+
+
+
+ +
+
+ hehehe +
+
first one
+
and second one
+
+

+ A Utility First, + Atomic CSS Framework +

+ For Building Collaborative Apps, Platforms and + UI's +

+ HTML and CSS, No JS Required... +

+ +
+
+
+
+ + COMPANY SECTION +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + Micro Component Architecture +
+
+
+
+ +
+
+

+ Micro Component Architecture +

+

+ Vanilla javascript, lightweight, single purpose + micro components. Easily modify, remove and/or + replace components. Highly configuarable using + HTML5 attributes. HTML5 developers can use a + combination of attributes to create a dynamic + experience. Javascript developers still have + access to API, callbacks and events. +

+

+ Sign Up Now +
+
+
+
+ + Collaborative Headless CMS +
+
+
+
+ +
+
+

+ Collaborative Headless CMS +

+

+ A lighting fast headless CMS over websocket, + providing CRUD and CRDT functionality. Create, + Read, Update, Delete and Filter lists. + Collaborate on Text, DOM and Objects. Configure + using HTML5 data-attibutes. Supports offline + editing and user cursor positions in Inputs, + Textareas, Rich Text Editors and Code Editors. + But of course... Javascript developers still + have access to API, callbacks and events. +

+ Get Your API Key +
+
+
+
+ + Fully Customizable Admin Panel +
+
+
+
+ +
+
+

+ Fully Customizable Admin Panel +

+

+ HTML5 Admin dashboard UI powered by CoCreateJS. + It is 100% editable and used to manage and + create views for your data and content. Use it + as a Collaborative CRM, CMS and ERP. Can be + modified, replaced or used as an example to + build your own custom HTML5 admin dashboard. +

+

+ Sign Up Now +
+
+
+
+ + Collaborative Builder +
+
+
+
+ +
+
+

+ Collaborative Drag-n-Drop Builder +

+

+ We are in the process of using CoCreateJS + components to create an experimental NO Code + expereince. Every page of the adminUI can be + edited in the drag and drop builder. CoCreate + builder UI is completely customizable and + supports editing of any html5 template. Can be + modified, replaced or used as an example to + build your own custom drang and drop builder. +

+
+
+
+
+ + Thirdparty API Intergration +
+
+
+
+ +
+
+

+ Thirdparty API Intergration +

+

+ We have put together a few thirdparty APIs and + developed them to be used and configured with + HTML5 attributes. Build custom flows and logic + without ever leaving the html page... The + CoCreate Way... Almost forgot, Javascript + developers still have access to API, callbacks + and events. +

+

+ Sign Up Now +
+
+
+
+ + +
+ + Footer + + + + + + diff --git a/docs/index.html b/docs/index.html index 8bf8d96..a4ca31e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,817 +1,1152 @@ - - - - - - - CoCreate Utility CSS Documentation | CoCreateCSS - - - - - - - - - - - - - - - - - -
-
-
-
-
-

CoCreate utility CSS

-
-
-
- - -
- -
-
-

CoCreate provides the most convenient utility class. -

-
-
- -

Usage

- -
-
- -
-

CoCreate utility Classes are very easy to use.

-

We can use exactly same class names with "style:value".

-
-
-                                
-<div class="padding:16px"></div>
-<div class="font-size:0.5rem color:red"></div>
-                                
-                            
-
-

Main styles and values provided as utility classes are as follows.

-
-
-
- -
-

direction

-
-
<div class="direction:ltr"></div>
-

ltr

-

rtl

-
-

display

-
-
<div class="display:block"></div>
-

block

-

inline-block

-

inline

-

none

-

inherit

-

table

-

table-cell

-

flex

-
-

overflow

-
-
<div class="overflow:auto"></div>
-

auto

-

visible

-

scroll

-

hidden

-
-

float

-
-
<div class="float:left"></div>
-

left

-

right

-

none

-
-

position

-
-
<div class="position:relative"></div>
-

inherit

-

relative

-

absolute

-

fixed

-

sticky

-
-

z-index

-
-
<div class="z-index:auto"></div>
-

auto

-

inherit

-

initial

-

-2

-

-5

-

1 ~ 15

-

100

-

101

-

111

-

1000

-

1111

-
-

top / bottom / left / right

-
-
<div class="top:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

bottom

-
-
<div class="bottom:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

left

-
-
<div class="left:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

right

-
-
<div class="right:auto"></div>
-

auto

-

0

-

1px ~ 50px

-

55px

-

60px

-

65px

-

...

-

100px

-

150px

-

200px

-

...

-

400px

-

-1px ~ -50px

-

-55px

-

-60px

-

-65px

-

...

-

-100px

-

-150px

-

-200px

-

...

-

-400px

-
-

height

-
-
<div class="height:0"></div>
-

0

-

1px ~ 10px

-

20px

-

30px

-

40px

-

45px

-

48px

-

50px

-

70px

-

80px

-

90px

-

100px

-

130px

-

150px

-

200px

-

250px

-

300px

-

350px

-

...

-

700px

-

auto

-

25%

-

33%

-

50%

-

66%

-

75%

-

100%

-

100%-120px

-

100vh-120px

-

100vh-100px

-

100vh-90px

-

100vh-70px

-

100vh-50px

-

80vh

-

90vh

-

100vh

-

fill-available

-

fit-content

-
-

min-height

-
-
<div class="min-height:100px"></div>
-

100px

-

200px

-

...

-

700px

-
-

max-height

-
-
<div class="max-height:300px"></div>
-

60px

-

100%

-
-

width

-
-
<div class="width:0"></div>
-

0

-

1px ~ 10px

-

15px

-

20px

-

25px

-

...

-

90px

-

100px

-

110px

-

120px

-

130px

-

150px

-

180px

-

200px

-

250px

-

300px

-

350px

-

...

-

1000px

-

10%

-

12%

-

15%

-

20%

-

25%

-

30%

-

35%

-

40%

-

41% ~ 50%

-

55%

-

60%

-

65%

-

70%

-

75%

-

80%

-

85%

-

90%

-

95%

-

100%

-

auto

-

unset

-

fill-available

-
-

min-width

-
-
<div class="min-width:75px"></div>
-

75px

-

100px

-

200px

-

250px

-

300px

-
-

max-width

-
-
<div class="max-width:300px"></div>
-

75px

-

100px

-

300px

-

400px

-

500px

-

600px

-

1050px

-
-

margin

-
-
<div class="margin:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-

auto-lr(left & right)

-

0-lr

-

0px_5px

-

0px_10px

-

10px_5px

-

...

-

100px-lr

-

auto_0px(top & bottom)

-

0_0px

-

5px_0px

-

10px_0px

-

15px_0px

-

...

-

100px_0px

-
-

margin-top

-
-
<div class="margin=top:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

margin-bottom

-
-
<div class="margin-bottom:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

margin-left

-
-
<div class="margin-left:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

margin-right

-
-
<div class="margin-right:auto"></div>
-

auto

-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding

-
-
<div class="padding:0"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-

0_0px(top & bottom)

-

5px_0px

-

10px_0px

-

15px_0px

-

...

-

100px_0px

-

0-lr(left & right)

-

1px-lr ~ 10px_5px

-

20px-lr

-

20px_5px

-

30px-lr

-

...

-

100px-lr

-
-

padding-top

-
-
<div class="padding-top:0"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding-bottom

-
-
<div class="padding-bottom:15px"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding-left

-
-
<div class="padding-left:15px"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

padding-right

-
-
<div class="padding-right:15px"></div>
-

0

-

5px

-

10px

-

15px

-

...

-

100px

-
-

border-width

-
-
<div class="border-width:0"></div>
-

0

-

1px ~ 10px

-

20px

-
-

border-color

-
-
<div class="border-color:black"></div>
-

white

-

black

-

extra-dark-gray

-

medium-dark-gray

-

dark-gray

-

extra-medium-gray

-

medium-gray

-

extra-light-gray

-

light-gray

-

light-pink

-

deep-pink

-

transparent-pink

-
-

border-style

-
-
<div class="border-style:dotted"></div>
-

dotted

-

dashed

-

solid

-

double

-

groove

-

ridge

-

inset

-

outset

-

none

-

hidden

-

transparent

-
-

border-radius

-
-
<div class="border-radius:0"></div>
-

0

-

1px ~ 10px

-

50px

-

50%

-

100%

-
-

font-size

-
-
<div class="font-size:18px"></div>
-

6px ~ 25px

-

30px

-

40px

-

50px

-

...

-

80px

-

01rem

-

02rem

-

03rem

-

04rem

-

05rem

-

1rem

-

2rem

-
-

font-weight

-
-
<div class="font-weight:800"></div>
-

100

-

200

-

300

-

...

-

900

-

bold

-
-

font-align

-
-
<div class="font-align:center"></div>
-

center

-

left

-

right

-
-

color

-
-
<div class="color:blue"></div>
-

white

-

black

-

extra-dark-gray

-

dark-gray

-

extra-medium-gray

-

medium-gray

-

extra-light-gray

-

light-gray

-

light-gray

-

very-light-gray

-

deep-pink

-

light-blue

-

blue

-
-

text-overflow

-
-
<div class="text-overflow:ellipsis"></div>
-

ellipsis

-
-

text-transform

-
-
<div class="text-transform:uppercase"></div>
-

uppercase

-
-

text-decoration

-
-
<div class="text-decoration:underline"></div>
-

underline

-
-

background-attachment

-
-
<div class="background-attachment:scroll"></div>
-

scroll

-

fixed

-

local

-

initial

-

inherit

-
-

background-repeat

-
-
<div class="background-repeat:repeat"></div>
-

repeat

-

repeat-x

-

repeat-y

-

no-repeat

-

initial

-

inherit

-
-

background-size

-
-
<div class="background-size:auto"></div>
-

auto

-

cover

-

contain

-

initial

-

inherit

-
-

background-position

-
-
<div class="background-position:center"></div>
-

left-top

-

left-center

-

left-bottom

-

right-top

-

right-center

-

right-bottom

-

center

-

center-top

-

center-center

-

center-bottom

-

initial

-

inherit

-
-

bg (background)

-
-
<div class="background:blue"></div>
-

transparent

-

white

-

black

-

dark-blue

-

extra-dark-gray

-

dark-gray

-

extra-medium-gray

-

medium-gray

-

extra-light-gray

-

medium-light-gray

-

light-gray

-

very-light-gray

-

deep-pink

-

transparent-white

-

transparent-black

-

white-opacity

-

black-opacity

-

black-opacity-light

-

deep-pink-opacity

-

charcoal-gray

-

blue

-
-

background

-
-
<div class="background:black"></div>
-

transparent

-

white

-

black

-

dark-blue

-
-

opacity

-
-
<div class="opacity:block"></div>
-

0

-

0.1

-

0.2

-

0.3

-

...

-

0.9

-

1

-
-

cursor

-
-
<div class="cursor:auto"></div>
-

alias

-

all-scroll

-

auto

-

cell

-

context-menu

-

col-resize

-

copy

-

crosshair

-

default

-

e-resize

-

ew-resize

-

grab

-

grabbing

-

help

-

move

-

n-resize

-

ne-resize

-

nesw-resize

-

ns-resize

-

nw-resize

-

nwse-resize

-

no-drop

-

none

-

not-allowed

-

pointer

-

progress

-

row-resize

-

s-resize

-

se-resize

-

sw-resize

-

text

-

url

-

w-resize

-

wait

-

zoom-in

-

zoom-out

-
-
-
-
- -
- -

Demo

- -
-
-
-
-
- - - - - - - -
- -
- -
- -
-
-
-
-
- -
- -
- -
-
-
- -
-
-
- -
- - - - - - - - \ No newline at end of file + + + + + + + CoCreate Utility CSS Documentation | CoCreateCSS + + + + + + + + + + + + + + + + + +
+
+
+
+
+

CoCreate utility CSS

+
+
+
+ + +
+ +
+
+

+ CoCreate provides the most convenient utility class. +

+
+
+
+ +

Usage

+ +
+
+ +
+

+ CoCreate utility Classes are very easy to use. +

+

+ We can use exactly same class names with + "style:value". +

+
+
+                                
+<div class="padding:16px"></div>
+<div class="font-size:0.5rem color:red"></div>
+                                
+                            
+
+

+ Main styles and values provided as utility classes + are as follows. +

+
+
+
+ +
+

+ direction +

+
+
<div class="direction:ltr"></div>
+

ltr

+

rtl

+
+

+ display +

+
+
<div class="display:block"></div>
+

block

+

inline-block

+

inline

+

none

+

inherit

+

table

+

table-cell

+

flex

+
+

+ overflow +

+
+
<div class="overflow:auto"></div>
+

auto

+

visible

+

scroll

+

hidden

+
+

+ float +

+
+
<div class="float:left"></div>
+

left

+

right

+

none

+
+

+ position +

+
+
<div class="position:relative"></div>
+

inherit

+

relative

+

absolute

+

fixed

+

sticky

+
+

+ z-index +

+
+
<div class="z-index:auto"></div>
+

auto

+

inherit

+

initial

+

-2

+

-5

+

1 ~ 15

+

100

+

101

+

111

+

1000

+

1111

+
+

+ top / bottom / left / right +

+
+
<div class="top:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ bottom +

+
+
<div class="bottom:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ left +

+
+
<div class="left:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ right +

+
+
<div class="right:auto"></div>
+

auto

+

0

+

1px ~ 50px

+

55px

+

60px

+

65px

+

...

+

100px

+

150px

+

200px

+

...

+

400px

+

-1px ~ -50px

+

-55px

+

-60px

+

-65px

+

...

+

-100px

+

-150px

+

-200px

+

...

+

-400px

+
+

+ height +

+
+
<div class="height:0"></div>
+

0

+

1px ~ 10px

+

20px

+

30px

+

40px

+

45px

+

48px

+

50px

+

70px

+

80px

+

90px

+

100px

+

130px

+

150px

+

200px

+

250px

+

300px

+

350px

+

...

+

700px

+

auto

+

25%

+

33%

+

50%

+

66%

+

75%

+

100%

+

100%-120px

+

100vh-120px

+

100vh-100px

+

100vh-90px

+

100vh-70px

+

100vh-50px

+

80vh

+

90vh

+

100vh

+

fill-available

+

fit-content

+
+

+ min-height +

+
+
<div class="min-height:100px"></div>
+

100px

+

200px

+

...

+

700px

+
+

+ max-height +

+
+
<div class="max-height:300px"></div>
+

60px

+

100%

+
+

+ width +

+
+
<div class="width:0"></div>
+

0

+

1px ~ 10px

+

15px

+

20px

+

25px

+

...

+

90px

+

100px

+

110px

+

120px

+

130px

+

150px

+

180px

+

200px

+

250px

+

300px

+

350px

+

...

+

1000px

+

10%

+

12%

+

15%

+

20%

+

25%

+

30%

+

35%

+

40%

+

41% ~ 50%

+

55%

+

60%

+

65%

+

70%

+

75%

+

80%

+

85%

+

90%

+

95%

+

100%

+

auto

+

unset

+

fill-available

+
+

+ min-width +

+
+
<div class="min-width:75px"></div>
+

75px

+

100px

+

200px

+

250px

+

300px

+
+

+ max-width +

+
+
<div class="max-width:300px"></div>
+

75px

+

100px

+

300px

+

400px

+

500px

+

600px

+

1050px

+
+

+ margin +

+
+
<div class="margin:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+

+ auto-lr(left & right) +

+

0-lr

+

0px_5px

+

0px_10px

+

10px_5px

+

...

+

100px-lr

+

+ auto_0px(top & bottom) +

+

0_0px

+

5px_0px

+

10px_0px

+

15px_0px

+

...

+

100px_0px

+
+

+ margin-top +

+
+
<div class="margin=top:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ margin-bottom +

+
+
<div class="margin-bottom:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ margin-left +

+
+
<div class="margin-left:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ margin-right +

+
+
<div class="margin-right:auto"></div>
+

auto

+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding +

+
+
<div class="padding:0"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+

+ 0_0px(top & bottom) +

+

5px_0px

+

10px_0px

+

15px_0px

+

...

+

100px_0px

+

0-lr(left & right)

+

1px-lr ~ 10px_5px

+

20px-lr

+

20px_5px

+

30px-lr

+

...

+

100px-lr

+
+

+ padding-top +

+
+
<div class="padding-top:0"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding-bottom +

+
+
<div class="padding-bottom:15px"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding-left +

+
+
<div class="padding-left:15px"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ padding-right +

+
+
<div class="padding-right:15px"></div>
+

0

+

5px

+

10px

+

15px

+

...

+

100px

+
+

+ border-width +

+
+
<div class="border-width:0"></div>
+

0

+

1px ~ 10px

+

20px

+
+

+ border-color +

+
+
<div class="border-color:black"></div>
+

white

+

black

+

extra-dark-gray

+

medium-dark-gray

+

dark-gray

+

extra-medium-gray

+

medium-gray

+

extra-light-gray

+

light-gray

+

light-pink

+

deep-pink

+

transparent-pink

+
+

+ border-style +

+
+
<div class="border-style:dotted"></div>
+

dotted

+

dashed

+

solid

+

double

+

groove

+

ridge

+

inset

+

outset

+

none

+

hidden

+

transparent

+
+

+ border-radius +

+
+
<div class="border-radius:0"></div>
+

0

+

1px ~ 10px

+

50px

+

50%

+

100%

+
+

+ font-size +

+
+
<div class="font-size:18px"></div>
+

6px ~ 25px

+

30px

+

40px

+

50px

+

...

+

80px

+

01rem

+

02rem

+

03rem

+

04rem

+

05rem

+

1rem

+

2rem

+
+

+ font-weight +

+
+
<div class="font-weight:800"></div>
+

100

+

200

+

300

+

...

+

900

+

bold

+
+

+ font-align +

+
+
<div class="font-align:center"></div>
+

center

+

left

+

right

+
+

+ color +

+
+
<div class="color:blue"></div>
+

white

+

black

+

extra-dark-gray

+

dark-gray

+

extra-medium-gray

+

medium-gray

+

extra-light-gray

+

light-gray

+

light-gray

+

very-light-gray

+

deep-pink

+

light-blue

+

blue

+
+

+ text-overflow +

+
+
<div class="text-overflow:ellipsis"></div>
+

ellipsis

+
+

+ text-transform +

+
+
<div class="text-transform:uppercase"></div>
+

uppercase

+
+

+ text-decoration +

+
+
<div class="text-decoration:underline"></div>
+

underline

+
+

+ background-attachment +

+
+
<div class="background-attachment:scroll"></div>
+

scroll

+

fixed

+

local

+

initial

+

inherit

+
+

+ background-repeat +

+
+
<div class="background-repeat:repeat"></div>
+

repeat

+

repeat-x

+

repeat-y

+

no-repeat

+

initial

+

inherit

+
+

+ background-size +

+
+
<div class="background-size:auto"></div>
+

auto

+

cover

+

contain

+

initial

+

inherit

+
+

+ background-position +

+
+
<div class="background-position:center"></div>
+

left-top

+

left-center

+

left-bottom

+

right-top

+

right-center

+

right-bottom

+

center

+

center-top

+

center-center

+

center-bottom

+

initial

+

inherit

+
+

+ bg (background) +

+
+
<div class="background:blue"></div>
+

transparent

+

white

+

black

+

dark-blue

+

extra-dark-gray

+

dark-gray

+

extra-medium-gray

+

medium-gray

+

extra-light-gray

+

medium-light-gray

+

light-gray

+

very-light-gray

+

deep-pink

+

transparent-white

+

transparent-black

+

white-opacity

+

black-opacity

+

black-opacity-light

+

deep-pink-opacity

+

charcoal-gray

+

blue

+
+

+ background +

+
+
<div class="background:black"></div>
+

transparent

+

white

+

black

+

dark-blue

+
+

+ opacity +

+
+
<div class="opacity:block"></div>
+

0

+

0.1

+

0.2

+

0.3

+

...

+

0.9

+

1

+
+

+ cursor +

+
+
<div class="cursor:auto"></div>
+

alias

+

all-scroll

+

auto

+

cell

+

context-menu

+

col-resize

+

copy

+

crosshair

+

default

+

e-resize

+

ew-resize

+

grab

+

grabbing

+

help

+

move

+

n-resize

+

ne-resize

+

nesw-resize

+

ns-resize

+

nw-resize

+

nwse-resize

+

no-drop

+

none

+

not-allowed

+

pointer

+

progress

+

row-resize

+

s-resize

+

se-resize

+

sw-resize

+

text

+

url

+

w-resize

+

wait

+

zoom-in

+

zoom-out

+
+
+
+
+ +
+ +

Demo

+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+ + + + + +
+
+ +
+
+
+ +
+ + + + + + diff --git a/package.json b/package.json index ed97f99..7cea1e9 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,10 @@ { "name": "@cocreate/css-parser", - "version": "1.0.11", + "version": "1.17.0", "description": "A simple css-parser component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.", "keywords": [ "css-parser", - "cocreate", - "low-code-framework", - "no-code-framework", - "cocreatejs", - "cocreatejs-component", - "cocreate-framework", - "no-code", "low-code", - "collaborative-framework", "realtime", "realtime-framework", "collaboration", @@ -25,10 +17,9 @@ }, "scripts": { "start": "npx webpack --config webpack.config.js", - "build": "NODE_ENV=production npx webpack --config webpack.config.js", + "build": "npx webpack --mode=production --config webpack.config.js", "dev": "npx webpack --config webpack.config.js --watch", - "docs": "node ./node_modules/@cocreate/docs/src/index.js", - "hosting": "node ./node_modules/@cocreate/hosting/src/index.js" + "postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\"" }, "repository": { "type": "git", @@ -46,24 +37,16 @@ }, "main": "./src/index.js", "devDependencies": { - "@babel/core": "^7.9.6", - "@babel/preset-env": "^7.9.6", - "babel-loader": "^8.1.0", - "clean-webpack-plugin": "^3.0.0", - "file-loader": "^6.2.0", - "html-webpack-plugin": "^4.5.0", + "css-loader": "^5.1.3", + "esbuild": "^0.25.2", + "esbuild-loader": "^4.3.0", "mini-css-extract-plugin": "^1.5.0", - "style-loader": "^2.0.0", - "terser-webpack-plugin": "^5.1.1", - "uglifyjs-webpack-plugin": "^2.2.0", "webpack": "^5.24.4", "webpack-cli": "^4.5.0", "webpack-log": "^3.0.1" }, "dependencies": { - "@cocreate/crud-client": "^1.12.11", - "@cocreate/docs": "^1.3.17", - "@cocreate/hosting": "^1.4.0", - "@cocreate/observer": "^1.5.16" + "@cocreate/local-storage": "^1.16.2", + "@cocreate/observer": "^1.18.1" } } diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..c184de6 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,16 @@ +module.exports = { + tabWidth: 4, + semi: true, + trailingComma: "none", + bracketSameLine: true, + useTabs: true, + overrides: [ + { + files: ["*.json", "*.yml", "*.yaml"], + options: { + tabWidth: 2, + useTabs: false + }, + } + ], + }; \ No newline at end of file diff --git a/release.config.js b/release.config.js index 68e4063..968bc8c 100644 --- a/release.config.js +++ b/release.config.js @@ -1,22 +1,22 @@ -module.exports = { - dryRun: false, - branches: ["master"], - plugins: [ - "@semantic-release/commit-analyzer", - "@semantic-release/release-notes-generator", - [ - "@semantic-release/changelog", - { - changelogFile: "CHANGELOG.md", - }, - ], - "@semantic-release/npm", - "@semantic-release/github", - [ - "@semantic-release/git", - { - assets: ["CHANGELOG.md", "package.json"], - }, - ], - ], +module.exports = { + dryRun: false, + branches: ["master"], + plugins: [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/changelog", + { + changelogFile: "CHANGELOG.md", + }, + ], + "@semantic-release/npm", + "@semantic-release/github", + [ + "@semantic-release/git", + { + assets: ["CHANGELOG.md", "package.json"], + }, + ], + ], }; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 01cf63a..53812d9 100644 --- a/src/index.js +++ b/src/index.js @@ -1,302 +1,664 @@ -/******************************************************************************** - * Copyright (C) 2020 CoCreate LLC and others. - * - * - * SPDX-License-Identifier: MIT - ********************************************************************************/ - import observer from '@cocreate/observer'; - import crud from '@cocreate/crud-client'; - - const themes = ["light", "dark"]; - const mediaRangeNames = ["xs", "sm", "md", "lg", "xl"]; - const ranges = { - xs: [0, 575], - sm: [576, 768], - md: [769, 992], - lg: [993, 1200], - xl: [1201, 0], - }; - const rangesArray = Object.values(ranges); - - let classNameList = new Map(); - - let tempStyleList = []; - let parsedCSS = []; - let linkCSS = []; - let themeCSS = { dark: [], light: [] }; - let styleElSheet; - - let linkTag = document.querySelector('link[collection][document_id][name]:not([save="false"])'); - - function init() { - let parse; - if (linkTag) - parse = linkTag.getAttribute('parse'); - // if (document.querySelector('link[parse="false"]')) - // return; - - let styleEl = document.createElement("style"); - styleEl.setAttribute('component', 'CoCreateCss'); - document.head.appendChild(styleEl); - styleElSheet = styleEl.sheet; - - parseLinkCSS(); - - if (parse != false) { - let elements = document.querySelectorAll("[class]"); - initElements(elements); - } - - observerInit(); - } - - function initElements (elements) { - for(let element of elements) - initElement(element); - addNewRules(); - } - - function initElement(element) { - parseClassList(element.classList); - createThemeMedia(); - if (element.hasAttribute("className")) { - let rule = "." + element.getAttribute("className") + " { " + element.getAttribute("class").replace(/ /g, "; ").replace(/:/g, ": ") + "; }"; - tempStyleList.push(rule); - } - } - - function parseLinkCSS() { - if (linkTag && linkTag.sheet) { - let Rules = linkTag.sheet.cssRules; - if (Rules) - for (let rule of Rules) { - try { - linkCSS.push(rule.cssText); - if (rule.selectorText) { - classNameList.set(rule.selectorText.replace(/[.\\]/g, ''), true); - } else { - // ToDo: handle media queriesand add to classNameList to avoid duplicate parsing - } - } - catch (err) { - console.error(err); - } - } - } - } - - function parseClassList(classList) { - for (let className of classList) { - if (classNameList.has(className)) continue; - - if (className.includes('@dark') || className.includes('@light')) { - createThemeRule(className) ; - } - else if (className.includes(':')) { - if (className.includes('@')) { - createMediaRule(className); - } - else { - let rule = createRule(className); - tempStyleList.push(rule); - classNameList.set(className, true); - } - } - } - } - - function createRule(className) { - let important = ""; - let importantSuffix = ""; - if (className.includes('!important')) { - [className, important] = className.split("!"); - important = '!' + important; - importantSuffix = '\\' + important; - } - let res = className.split(":"); - let property = res[0]; - let suffix = parseValue(res[1]); - let value = res[1].split("@")[0].replace(/_/g, " "); - - let rule = ""; - if (res.length > 2) { - for (let i = 0; i < res.length - 2; i++) { - suffix += "\\:" + res[2 + i] + importantSuffix + ":" + res[2]; - } - rule = `.${property}\\:${suffix} { ${property}: ${value}${important}; }`; - } - else { - rule = `.${property}\\:${suffix}${importantSuffix} { ${property}: ${value}${important}; }`; - } - return rule; - } - - function parseValue(value) { - return value - .replace(/\./g, "\\.") - .replace(/%/g, "\\%") - .replace(/@/g, "\\@") - .replace(/\(/g, "\\(") - .replace(/\)/g, "\\)") - .replace(/#/g, "\\#") - .replace(/,/g, "\\,") - .replace(/!/g, "\\!") - .replace(/\//g, "\\/") - .replace(/\"/g, "\\\"") - .replace(/\'/g, "\\'"); - } - - function createMediaRule(className) { - let parts = className.split("@"); - let main_rule = createRule(className); - - for (let i = 1; i < parts.length; i++) { - let range_num = mediaRangeNames.indexOf(parts[i]); - let range = []; - if (range_num != -1) range = rangesArray[range_num]; - else { - let customRange = parts[i].split('-'); - range = customRange.map(c => Number.parseInt(c)); - } - let prefix = "@media screen"; - if (range[0] != 0) { - prefix += " and (min-width:" + range[0] + "px)"; - } - if (range[1] != 0) { - prefix += " and (max-width:" + range[1] + "px)"; - } - let rule = prefix + " { " + main_rule + "}"; - tempStyleList.push(rule); - classNameList.set(className, true); - } - } - - function createThemeRule(className) { - let classname = className; - let pseudo, theme; - [className, theme] = className.split('@'); - - if (theme.includes(':')) { - theme = theme.split(':'); - pseudo = theme; - theme = theme[0]; - pseudo.shift(); - } - - let res = className.split(':'); - if (res.length > 2) { - console.log('pseudo names need to be added after theme'); - return; - } - let property = res[0]; - let suffix = parseValue(res[1]); - let value = res[1].replace(/_/g, " "); - - let rule = ""; - if (pseudo) { - suffix += "\\@" + theme; - for (let i = 0; i < pseudo.length; i++) { - suffix += ":" + pseudo[0 + i]; - } - rule = `.${property}\\:${suffix} { ${property}: ${value}; }`; - } - else { - rule = `.${property}\\:${suffix}\\@${theme} { ${property}: ${value}; }`; - } - if (theme == 'dark' || theme == 'light') { - rule = `[theme="${theme}"] ${rule}`; - let reverseRule = `html:not([theme="${themes[1 - themes.indexOf(theme)]}"]) ${rule}`; - tempStyleList.push(rule); - themeCSS[theme].push(reverseRule); - classNameList.set(classname, true); - } - } - - function createThemeMedia() { - let initial; - if (themeCSS.dark.length) { - initial = "@media (prefers-color-scheme: dark) {"; - for (let c of themeCSS.dark) { - initial += c + "\n"; - } - initial += "}"; - tempStyleList.push(initial); - themeCSS.dark = []; - } - if (themeCSS.light.length) { - initial = "@media (prefers-color-scheme: light) {"; - for (let c of themeCSS.light) { - initial += c + "\n"; - } - initial += "}"; - tempStyleList.push(initial); - themeCSS.light = []; - } - - } - - function addNewRules() { - for (let i = 0, len = tempStyleList.length; i < len; i++) { - let rule = tempStyleList[i]; - - let low = 0, - high = parsedCSS.length; - while (low < high) { - let index = (low + high) >>> 1; - let midItem = parsedCSS[index]; - if (rule < midItem) - high = index; - else - low = index + 1; - } - - if (low > styleElSheet.cssRules.length) low = styleElSheet.cssRules.length; - try { - styleElSheet.insertRule(rule, low); - } - catch (err) { - console.error(err); - } - parsedCSS.splice(low, 0, rule); - } - if (tempStyleList.length > 0) - save(); - tempStyleList = []; - } - - function save() { - if (linkTag) { - const onlyUnique = (value, index, self) => { - return self.indexOf(value) === index; - }; - - let css = parsedCSS.concat(linkCSS).filter(onlyUnique); - crud.save(linkTag, css.join('\r\n')); - } - } - - const observerInit = () => { - - observer.init({ - name: "ccCss", - observe: ['childList'], - target: '[class]', - callback: mutation => { - initElements(mutation.addedNodes); - } - }); - - observer.init({ - name: "ccCss", - observe: ["attributes"], - attributeName: ["class", "className"], - callback: mutation => { - initElements([mutation.target]); - } - }); - }; - - init(); - - export default {initElements}; - \ No newline at end of file +/******************************************************************************** + * Copyright (C) 2020 CoCreate LLC and others. + * + * SPDX-License-Identifier: MIT + ********************************************************************************/ + +import observer from "@cocreate/observer"; +import localStorage from "@cocreate/local-storage"; + +/** + * @typedef {('xxxs'|'xxs'|'xs'|'sm'|'md'|'lg'|'xl'|'xxl')} MediaRangeName + * * Defines a comprehensive set of responsive screen size breakpoints in pixels (or device-independent pixels). + * The ranges are inclusive on the minimum width and exclusive on the maximum width (max-width - 1). + * '0' in the second position of a range signifies 'and up' (e.g., [1401, 0] means >= 1401px). + * + * Tiers: + * - xxxs: Smallest Smartwatches (0px to 191px) + * - xxs: Medium-Large Smartwatches (192px to 319px) + * - xs: Smallest Smartphones (320px to 575px) + * - sm: Landscape Phones & Small Tablets (576px to 768px) + * - md: Tablets (769px to 992px) + * - lg: Small Desktops & Laptops (993px to 1200px) + * - xl: Standard Desktops (1201px to 1400px) + * - xxl: Large Monitors, TVs (1401px and up) + * * @type {MediaRangeName[]} + */ +const mediaRangeNames = ["xxxs", "xxs", "xs", "sm", "md", "lg", "xl", "xxl"]; + +/** + * @type {Object.} + */ +const ranges = { + xxxs: [0, 191], + xxs: [192, 319], + xs: [320, 575], + sm: [576, 768], + md: [769, 992], + lg: [993, 1200], + xl: [1201, 1400], + xxl: [1401, 0] +}; + +// Rule III.5.a: Magic Aliases (used by parseMediaQueryString) +const mediaFeatureAliases = { + dark: "prefers-color-scheme", + light: "prefers-color-scheme", + landscape: "orientation", + portrait: "orientation", + print: "print", + screen: "screen" +}; + +/** + * @typedef {('h-xxxs'|'h-xxs'|'h-xs'|'h-sm'|'h-md'|'h-lg'|'h-xl'|'h-xxl')} HeightRangeName + * + * Defines a comprehensive set of responsive screen size breakpoints for the + * vertical (height) dimension in pixels (or device-independent pixels). + * The numerical values mirror the width breakpoints to maintain a unified + * design scale across orientation flips (e.g., a 769px screen is 'md' size, + * whether it's width or height). + * + * The ranges are inclusive on the minimum and exclusive on the maximum (max-1). + * '0' in the second position signifies 'and up'. + * + * Tiers: + * - h-xxxs: Smallest Smartwatches (0px to 191px) + * - h-xxs: Medium-Large Smartwatches (192px to 319px) + * - h-xs: Smallest Phones Landscape / Extreme Condensation (320px to 575px) + * - h-sm: Landscape Phones & Small Tablets (576px to 768px) + * - h-md: Tablets / Comfortable Vertical Space (769px to 992px) + * - h-lg: Small Desktops / Ample Vertical Space (993px to 1200px) + * - h-xl: Standard Desktops (1201px to 1400px) + * - h-xxl: Large Monitors, TVs (1401px and up) + * * NOTE: These are typically used with 'max-height' CSS media queries to trigger + * condensation (removing complexity as vertical space runs out). + */ +const heightRangeNames = ["h-xxxs", "h-xxs", "h-xs", "h-sm", "h-md", "h-lg", "h-xl", "h-xxl"]; + +/** + * The Height Breakpoint Ranges. + * @type {Object.} + */ +const heightRanges = { + 'h-xxxs': [0, 191], + 'h-xxs': [192, 319], + 'h-xs': [320, 575], + 'h-sm': [576, 768], + 'h-md': [769, 992], + 'h-lg': [993, 1200], + 'h-xl': [1201, 1400], + 'h-xxl': [1401, 0] +}; + +// classNameList will now store the directClassName for className attribute rules +// and the declarationsByMediaQuery object for merging. +let classNameList = new Map(); +let tempStyleList = []; +let parsedCSS = []; +let linkCSS = []; // Added back to store rules from the linked stylesheet +let styleElSheet; +let parse; +let linkTag; + +function escapeClassName(str) { + if (typeof CSS !== "undefined" && CSS.escape) { + return CSS.escape(str); + } + // Fallback for browsers that don't support CSS.escape + return str.replace( + /[^_a-zA-Z0-9-]/g, + (c) => "\\" + c.charCodeAt(0).toString(16).padStart(2, "0") + ); +} + +function init(_linkTag) { + linkTag = _linkTag; + if (!linkTag) return; + + parse = linkTag.getAttribute("parse"); + + // Use existing style element if it exists, otherwise create a new one + let styleEl = + document.getElementById("CoCreateCSS_Rules") || + document.createElement("style"); + styleEl.id = "CoCreateCSS_Rules"; + styleEl.setAttribute("component", "css-parser"); + + // Append to head if not already present + if (!document.head.contains(styleEl)) { + document.head.appendChild(styleEl); + } + // Get the stylesheet object + styleElSheet = styleEl.sheet; + + // Check localStorage for parse setting if not explicitly set on the link tag + if (parse === null && typeof localStorage !== "undefined") { + parse = localStorage.getItem("cssParser"); + } + + // If parse is explicitly false, stop initialization + if (parse === "false" || parse === false) return; + + // Parse existing CSS from the linked stylesheet + parseLinkCSS(); + + // Add getValue function to linkTag for saving + linkTag.getValue = () => { + const onlyUnique = (value, index, self) => { + return self.indexOf(value) === index; + }; + + const urlObject = new URL(linkTag.href); + const pathParts = urlObject.pathname.split("/"); + + let data = {}; + data.name = pathParts[pathParts.length - 1]; + data.path = urlObject.pathname.replace(data.name, ""); + data.pathname = urlObject.pathname; + // Combine parsed and linked CSS, filter for uniqueness, and join + data.src = parsedCSS.concat(linkCSS).filter(onlyUnique).join("\r\n"); + data["content-type"] = "text/css"; + + return data; + }; + + // If parse is true or null, initialize elements + if (parse === "true" || parse === true || parse === null) { + let elements = document.querySelectorAll("[class]"); + initElements(elements); + } + + // Initialize observers for dynamic changes + observerInit(); +} + +function initElements(elements) { + // Process each element with a class attribute + for (let el of elements) { + if (el.classList && el.classList.length > 0) { + initElement(el); + } + } + // Add all newly generated rules to the stylesheet + addNewRules(); +} + +function initElement(element) { + const classList = element.classList; + const directClassName = element.getAttribute("className"); + const classAttrValue = element.getAttribute("class"); + + // Parse all classes in the classList to get rule details including the full rule string + // parseClassList now handles splitting by '@' for multiple media queries within one class name + const parsedRuleDetails = parseClassList(classList); + + // Process atomic rules first if no className attribute is present + if (!(directClassName && classAttrValue)) { + parsedRuleDetails.forEach((ruleDetail) => { + // Check if this atomic class name has already been processed + // Note: ruleDetail.className will now include the @ and media query part if it exists + if (classNameList.has(ruleDetail.className)) { + return; // Skip if already processed + } + + // Add the full atomic rule string to the temporary list + tempStyleList.push(ruleDetail.ruleString); + classNameList.set(ruleDetail.className, true); // Mark the atomic class name as processed + }); + } + + // Now, if className attribute exists and class attribute has value, process combined rules + if (directClassName && classAttrValue) { + // Get existing declarations or initialize new ones for this className + const existingDeclarationsByMediaQuery = classNameList.get( + directClassName + ) || { nonMedia: [] }; + + // Object to group declarations from the current element's classList by media query + const newDeclarationsByMediaQuery = { + nonMedia: [] + }; + + // Group declarations from parsed rule details by media query for the current element + // Note: parsedRuleDetails now contains details for each @ segment within a class name + parsedRuleDetails.forEach((ruleDetail) => { + if (ruleDetail.declarationString) { + // Ensure declarationString exists + const mediaQuery = ruleDetail.isMedia + ? ruleDetail.mediaQuery + : "nonMedia"; + if (!newDeclarationsByMediaQuery[mediaQuery]) { + newDeclarationsByMediaQuery[mediaQuery] = []; + } + newDeclarationsByMediaQuery[mediaQuery].push( + ruleDetail.declarationString + ); + } + }); + + // Merge new declarations into existing ones + let declarationsMerged = false; + for (const mediaQueryString in newDeclarationsByMediaQuery) { + const newDeclarations = + newDeclarationsByMediaQuery[mediaQueryString]; + if (newDeclarations.length > 0) { + if (!existingDeclarationsByMediaQuery[mediaQueryString]) { + existingDeclarationsByMediaQuery[mediaQueryString] = []; + } + // Add only unique new declarations to avoid duplicates during merge + newDeclarations.forEach((decl) => { + if ( + !existingDeclarationsByMediaQuery[ + mediaQueryString + ].includes(decl) + ) { + existingDeclarationsByMediaQuery[mediaQueryString].push( + decl + ); + declarationsMerged = true; + } + }); + } + } + + // If any new declarations were merged, update classNameList and regenerate rules + // Also regenerate if this className is being processed for the first time + if (declarationsMerged || !classNameList.has(directClassName)) { + // Store the updated declarationsByMediaQuery object in classNameList + classNameList.set( + directClassName, + existingDeclarationsByMediaQuery + ); + + // Remove old rules for this className from tempStyleList and parsedCSS + // This is a simple approach; a more robust solution might track rule indices + tempStyleList = tempStyleList.filter( + (rule) => !rule.includes(`.${escapeClassName(directClassName)}`) + ); + parsedCSS = parsedCSS.filter( + (rule) => !rule.includes(`.${escapeClassName(directClassName)}`) + ); + + const escapedDirectClassName = escapeClassName(directClassName); + + // Generate rules for the className selector based on merged declarations + for (const mediaQueryString in existingDeclarationsByMediaQuery) { + const declarations = + existingDeclarationsByMediaQuery[mediaQueryString]; + if (declarations.length > 0) { + const combinedDeclarations = declarations.join("; "); + const ruleContent = `.${escapedDirectClassName} { ${combinedDeclarations}; }`; + + if (mediaQueryString === "nonMedia") { + // Create a regular rule for non-media declarations + const rule = ruleContent; + tempStyleList.push(rule); + } else { + // Create a media query rule + const mediaRule = `@media ${mediaQueryString} { ${ruleContent} }`; + tempStyleList.push(mediaRule); + } + } + } + } + } +} + +// Helper function to parse media query string from class name part (e.g., "@sm&dark") +function parseMediaQueryString(mediaQueryPart) { + if (!mediaQueryPart.startsWith("@")) return null; + let currentQuery = mediaQueryPart.substring(1); + + const parseFeature = (featStr) => { + featStr = featStr.trim(); + if (!featStr) return null; + + let isNot = false; + if (featStr.startsWith("!")) { + isNot = true; + featStr = featStr.substring(1); + } + + let condition; + + if (featStr.startsWith("(") && featStr.endsWith(")")) { + condition = featStr.replace(/_/g, " "); + } else if (mediaFeatureAliases[featStr]) { + const mappedFeature = mediaFeatureAliases[featStr]; + condition = (mappedFeature === "print" || mappedFeature === "screen") + ? mappedFeature + : `(${mappedFeature}: ${featStr})`; + } else if (mediaRangeNames.includes(featStr)) { + const [min, max] = ranges[featStr]; + const rangeConditions = []; + if (min > 0 || featStr === "xxxs") rangeConditions.push(`(min-width: ${min}px)`); + if (max > 0) rangeConditions.push(`(max-width: ${max}px)`); + condition = rangeConditions.join(" and "); + } else if (heightRangeNames.includes(featStr)) { + const [min, max] = heightRanges[featStr]; + const rangeConditions = []; + if (min > 0 || featStr === "h-xxxs") rangeConditions.push(`(min-height: ${min}px)`); + if (max > 0) rangeConditions.push(`(max-height: ${max}px)`); + condition = rangeConditions.join(" and "); + } else if (/^\d+(\.\d+)?\D+$/.test(featStr) && !featStr.includes(":")) { + condition = `(max-width: ${featStr.replace(/_/g, " ")})`; + } else if (featStr.includes(":")) { + const [featureName, ...featureValueParts] = featStr.split(":"); + const featureValue = featureValueParts.join(":").replace(/_/g, " "); + condition = `(${featureName.trim()}: ${featureValue.trim()})`; + } else { + condition = featStr.replace(/_/g, " "); + } + + if (condition) { + return isNot ? `not ${condition}` : condition; + } + return null; + }; + + const consolidateAndGroup = (andGroup) => { + let ranges = { + minWidth: Infinity, + maxWidth: 0, + minHeight: Infinity, + maxHeight: 0, + }; + const otherConditions = []; + const rangeRegex = /\((min|max)-(width|height): *(\d+(\.\d+)?)px\)/; + + for (let condition of andGroup) { + const parts = condition.split(" and "); + let isRangeOnlyCondition = true; + for (let part of parts) { + if (!rangeRegex.test(part)) { + isRangeOnlyCondition = false; + break; + } + } + + if (isRangeOnlyCondition) { + for (let part of parts) { + const match = part.match(rangeRegex); + if (match) { + const [, type, dimension, value] = match; + const numValue = parseFloat(value); + if (type === "min" && dimension === "width") { + ranges.minWidth = Math.min(ranges.minWidth, numValue); + } else if (type === "max" && dimension === "width") { + ranges.maxWidth = Math.max(ranges.maxWidth, numValue); + } else if (type === "min" && dimension === "height") { + ranges.minHeight = Math.min(ranges.minHeight, numValue); + } else if (type === "max" && dimension === "height") { + ranges.maxHeight = Math.max(ranges.maxHeight, numValue); + } + } + } + } else { + // If the condition block contains non-range parts, add it as is. + if (!otherConditions.includes(condition)) { + otherConditions.push(condition); + } + } + } + + const consolidated = [...otherConditions]; + if (ranges.minWidth !== Infinity && ranges.minWidth > 0) consolidated.push(`(min-width: ${ranges.minWidth}px)`); + if (ranges.maxWidth > 0) consolidated.push(`(max-width: ${ranges.maxWidth}px)`); + if (ranges.minHeight !== Infinity && ranges.minHeight > 0) consolidated.push(`(min-height: ${ranges.minHeight}px)`); + if (ranges.maxHeight > 0) consolidated.push(`(max-height: ${ranges.maxHeight}px)`); + + return consolidated.join(" and "); + }; + + const tokens = []; + const operatorRegex = /([&,])/; + + while (currentQuery.length > 0) { + const match = currentQuery.match(operatorRegex); + if (match) { + const index = match.index; + const feature = currentQuery.substring(0, index); + const operator = match[0]; + if (feature) tokens.push(feature); + tokens.push(operator); + currentQuery = currentQuery.substring(index + 1); + } else { + tokens.push(currentQuery); + break; + } + } + + const orGroups = []; + let currentAndGroup = []; + + for (const token of tokens) { + if (token === '&') { + continue; + } + if (token === ',') { + if (currentAndGroup.length > 0) { + orGroups.push(consolidateAndGroup(currentAndGroup)); + currentAndGroup = []; + } + } else { + const condition = parseFeature(token); + if (condition) { + currentAndGroup.push(condition); + } + } + } + + if (currentAndGroup.length > 0) { + orGroups.push(consolidateAndGroup(currentAndGroup)); + } + + return orGroups.join(', '); +} + +function parseClassList(classList) { + const parsedDetails = []; + // Iterate through each class name on an element + for (let className of classList) { + // Skip if the class doesn't contain ':'' + if (!className.includes(":")) { + continue; + } + + // Split the class name by '@' to handle multiple media queries within one class name + const classNameParts = className.split("@"); + + let baseDeclarationPart = classNameParts[0]; + let important = ""; + if (baseDeclarationPart.includes("!important")) { + const parts = baseDeclarationPart.split("!important"); + baseDeclarationPart = parts[0]; + important = " !important"; // Add space before !important + } + + const parts = baseDeclarationPart.split(":"); + if (parts.length < 2) { + // If the base part doesn't have a property:value, skip this class name + continue; + } + + const property = parts.shift().trim(); + const rawValue = parts.join(":").trim(); + const value = rawValue.replace(/_/g, " "); + const declarationString = `${property}: ${value}${important}`; + const escapedClassName = escapeClassName(baseDeclarationPart); + const selectorClass = escapeClassName(className); + + // const escapedClassName = escapeClassName(className); + if (classNameParts.length === 1) { + // Process the base declaration part (non-media) + parsedDetails.push({ + className: selectorClass, + declarationString: declarationString, + isMedia: false, + mediaQuery: null, + ruleString: `.${selectorClass} { ${declarationString}; }` + }); + } else { + // Process each media query part + for (let i = 1; i < classNameParts.length; i++) { + const mediaQuerySegment = classNameParts[i]; + const fullMediaQueryPart = `@${mediaQuerySegment}`; // Add the '@' back + + const mediaQueryString = + parseMediaQueryString(fullMediaQueryPart); + + if (mediaQueryString) { + // Generate the full atomic media query rule string + const ruleContent = `.${selectorClass} { ${declarationString}; }`; + const ruleString = `@media ${mediaQueryString} { ${ruleContent} }`; + + parsedDetails.push({ + className: selectorClass, + declarationString: declarationString, + isMedia: true, + mediaQuery: mediaQueryString, + ruleString: ruleString + }); + } + } + } + } + return parsedDetails; // Return the list of parsed rule details +} + +function parseLinkCSS() { + // If a linkTag and its sheet exist + if (linkTag && linkTag.sheet) { + let Rules = linkTag.sheet.cssRules; + if (Rules) { + // Iterate through existing rules in the linked stylesheet + for (let rule of Rules) { + try { + // Store the CSS text of the rule + linkCSS.push(rule.cssText); + // If the rule has a selector (e.g., a class rule) + if (rule.selectorText) { + // Add the selector (cleaned) to classNameList to avoid re-parsing + classNameList.set( + rule.selectorText.replace(/[.\\]/g, ""), + true + ); + } else if (rule.cssRules) { + // If it's a media query rule, iterate through its inner rules + for (let innerRule of rule.cssRules) { + if (innerRule.selectorText) { + // Add inner rule selectors to classNameList + classNameList.set( + innerRule.selectorText.replace( + /[.\\]/g, + "" + ), + true + ); + } + } + } + } catch (err) { + console.error("Error parsing linked CSS rule:", err); + } + } + } + } +} + +let saveTimeout; +function addNewRules() { + if (tempStyleList.length === 0) return; // If no new rules, do nothing + + // Add new rules to the style sheet and parsedCSS array + for (let i = 0, len = tempStyleList.length; i < len; i++) { + let rule = tempStyleList[i]; + let low = 0, + high = parsedCSS.length; + // Find the correct insertion index to keep parsedCSS sorted + while (low < high) { + let mid = (low + high) >>> 1; + if (rule < parsedCSS[mid]) high = mid; + else low = mid + 1; + } + let insertIndex = low; + // Ensure insert index is within bounds of the actual stylesheet rules + if (styleElSheet && insertIndex > styleElSheet.cssRules.length) { + insertIndex = styleElSheet.cssRules.length; + } + try { + // Insert the rule into the stylesheet + if (styleElSheet) { + styleElSheet.insertRule(rule, insertIndex); + } + // Insert the rule into the sorted parsedCSS array + parsedCSS.splice(low, 0, rule); + } catch (err) { + console.error("Failed to insert rule:", rule, err); // Log errors if insertion fails. + } + } + + // If there are new rules and a linkTag with a save function exists, trigger save after a delay. + if ( + tempStyleList.length > 0 && + linkTag && + typeof linkTag.save === "function" + ) { + clearTimeout(saveTimeout); // Clear any existing timeout + saveTimeout = setTimeout(() => { + linkTag.save(); // Call the save function + }, 1000); // Save after 1 second delay + } + tempStyleList = []; // Clear the temporary list +} + +const observerInit = () => { + observer.init({ + name: "ccCss", + types: ["addedNodes"], + selector: "[class]", + callback: (mutation) => { + if (parse != "false") initElements([mutation.target]); + } + }); + + observer.init({ + name: "ccCss", + types: ["attributes"], + attributeFilter: ["class", "className"], + callback: (mutation) => { + if (parse != "false") initElements([mutation.target]); + } + }); +}; + +observer.init({ + name: "cssParseAddedNode", + types: ["addedNodes"], + selector: "link[parse], link[save], link[object]", + callback: (mutation) => { + init(mutation.target); + } +}); + +observer.init({ + name: "cssParseattributes", + types: ["attributes"], + attributeFilter: ["parse", "save", "object"], //ff + selector: "link", + callback: (mutation) => { + init(mutation.target); + } +}); + +// Auto-initialize if a relevant link tag is found on page load +const autoInitLinkTag = document.querySelector( + "link[parse], link[array][object][key]" +); +if (autoInitLinkTag) { + init(autoInitLinkTag); +} + +// Export functions for external use +export default { initElements, init }; diff --git a/webpack.config.js b/webpack.config.js index bb1c975..dffd4e5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,85 +1,65 @@ -const path = require("path") -const TerserPlugin = require("terser-webpack-plugin") -const MiniCssExtractPlugin = require("mini-css-extract-plugin") -let isProduction = process.env.NODE_ENV === "production" -const { CleanWebpackPlugin } = require("clean-webpack-plugin") +const path = require("path"); +const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const { EsbuildPlugin } = require("esbuild-loader"); +const { FileUploader } = require("@cocreate/webpack"); -module.exports = { - entry: { - "CoCreate-css-parser": "./src/index.js", - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: isProduction ? "[name].min.js" : "[name].js", - libraryTarget: "umd", - libraryExport: "default", - library: ["CoCreate", "css-parser"], - globalObject: "this", - // publicPath: 'https://server.cocreate.app/CoCreateJS/dist/' - }, - - plugins: [ - new CleanWebpackPlugin(), - new MiniCssExtractPlugin({ - filename: "[name].css", - }), - ], - // Default mode for Webpack is production. - // Depending on mode Webpack will apply different things - // on final bundle. For now we don't need production's JavaScript - // minifying and other thing so let's set mode to development - mode: isProduction ? "production" : "development", - module: { - rules: [ - { - test: /.js$/, - exclude: /(node_modules)/, - use: { - loader: "babel-loader", - options: { - plugins: ["@babel/plugin-transform-modules-commonjs"], - }, - }, - }, - { - test: /.css$/i, - use: [ - { loader: "style-loader", options: { injectType: "linkTag" } }, - "file-loader", - ], - }, - ], - }, - - // add source map - ...(isProduction ? {} : { devtool: "eval-source-map" }), - - optimization: { - minimize: true, - minimizer: [ - new TerserPlugin({ - extractComments: true, - // cache: true, - parallel: true, - // sourceMap: true, // Must be set to true if using source-maps in production - terserOptions: { - // https://github.com/webpack-contrib/terser-webpack-plugin#terseroptions - // extractComments: 'all', - compress: { - drop_console: true, - }, - }, - }), - ], - splitChunks: { - chunks: "all", - minSize: 200, - // maxSize: 99999, - //minChunks: 1, - - cacheGroups: { - defaultVendors: false, - }, - }, - }, -} +module.exports = async (env, argv) => { + const isProduction = argv && argv.mode === "production"; + const config = { + entry: { + "CoCreate-css-parser": "./src/index.js" + }, + output: { + path: path.resolve(__dirname, "dist"), + filename: isProduction ? "[name].min.js" : "[name].js", + libraryExport: "default", + library: ["CoCreate", "cssParser"], + clean: true + }, + plugins: [ + new MiniCssExtractPlugin({ + filename: isProduction ? "[name].min.css" : "[name].css" + }), + new FileUploader(env, argv) + ], + mode: isProduction ? "production" : "development", + devtool: isProduction ? "source-map" : "eval-source-map", + module: { + rules: [ + { + test: /.js$/, + exclude: /node_modules/, + use: { + loader: "esbuild-loader", + options: { + loader: "js", + target: "es2017" + } + } + }, + { + test: /.css$/i, + use: [MiniCssExtractPlugin.loader, "css-loader"] + } + ] + }, + optimization: { + minimize: isProduction, + minimizer: [ + new EsbuildPlugin({ + target: "es2017", + css: true + }) + ], + splitChunks: { + cacheGroups: { + defaultVendors: false + } + } + }, + performance: { + hints: isProduction ? "warning" : false + } + }; + return config; +};