@teacss/directives 0.9.0-alpha.3 → 0.9.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -34,10 +34,10 @@ export interface GenerateEntryOptions {
34
34
  base: string;
35
35
  /** Entry filename, when known, so local `@import` cycles include the root identity. */
36
36
  entryFile?: string;
37
- /** Read scanned content for the given include/exclude globs. Omit when `contents` is given. */
37
+ /** Scan content for the given include/exclude globs; `sources` may be omitted so the runtime reads the files. Omit when `contents` is given. */
38
38
  readSources?: (includes: string[], excludes: string[]) => Promise<{
39
39
  files: string[];
40
- sources: string[];
40
+ sources?: string[];
41
41
  }>;
42
42
  /** Inline content to extract utilities from — skips `readSources` (tests / programmatic use). */
43
43
  contents?: string[];
@@ -4,9 +4,9 @@ import { MagicStringLike } from "@teacss/core";
4
4
  export declare function prepareEasingCss(code: MagicStringLike): void;
5
5
  export declare function prepareEasingStylesheet(css: string): string;
6
6
  /**
7
- * Whether a stylesheet may hold a `cubic-bezier()` the guard rewrites: the name in plain text, or a
8
- * function name spelled with escapes. Escaped selectors such as `.p\:4` never end in an unescaped
9
- * "(", so they no longer force a full parse.
7
+ * Whether a stylesheet may hold a `cubic-bezier()` the guard rewrites: one whose arguments call a math
8
+ * function, a function name spelled with escapes, or arguments a plain scan cannot delimit. Literal
9
+ * curves never change, so they no longer force a full parse.
10
10
  */
11
11
  export declare function needsEasingEdits(css: string): boolean;
12
12
  //#endregion
@@ -1 +1 @@
1
- import{parse as e,walk as t}from"css-tree";import{normalizedCssIdentifier as n}from"@teacss/rule-helpers/css-value-syntax";import{prepareEasingOutput as r}from"@teacss/rule-helpers/internal/easing";const i=new Set([`animation`,`animation-timing-function`,`transition`,`transition-timing-function`]);function a(e){l(e.original,(t,n,r)=>e.overwrite(t,n,r))}function o(e){let t=[],n=0;return l(e,(r,i,a)=>{t.push(e.slice(n,r),a),n=i}),t.length?t.join(``)+e.slice(n):e}const s=/\\(?:[0-9a-f]{1,6}[ \t\n\r\f]?|[^\n\r\f0-9a-f])(?:[\w-]|\\(?:[0-9a-f]{1,6}[ \t\n\r\f]?|[^\n\r\f0-9a-f]))*\(/i;function c(e){return/bezier/i.test(e)||s.test(e)}function l(a,o){if(!c(a))return;let s=e(a,{positions:!0,parseValue:!1,parseCustomProperty:!1,parseAtrulePrelude:!1});t(s,{visit:`Declaration`,enter(e){let t=n(e.property).replace(/^-(?:webkit|moz|o)-/,``);if(!i.has(t)||!e.value.loc)return;let{start:s,end:c}=e.value.loc,l=a.slice(s.offset,c.offset),u=r(l);u!==l&&o(s.offset,c.offset,u)}})}export{c as needsEasingEdits,a as prepareEasingCss,o as prepareEasingStylesheet};
1
+ import{createRequire as e}from"node:module";import{normalizedCssIdentifier as t}from"@teacss/rule-helpers/css-value-syntax";import{prepareEasingOutput as n}from"@teacss/rule-helpers/internal/easing";const r=new Set([`animation`,`animation-timing-function`,`transition`,`transition-timing-function`]);function i(e){d(e.original,(t,n,r)=>e.overwrite(t,n,r))}function a(e){let t=[],n=0;return d(e,(r,i,a)=>{t.push(e.slice(n,r),a),n=i}),t.length?t.join(``)+e.slice(n):e}const o=/\\(?:[0-9a-f]{1,6}[ \t\n\r\f]?|[^\n\r\f0-9a-f])(?:[\w-]|\\(?:[0-9a-f]{1,6}[ \t\n\r\f]?|[^\n\r\f0-9a-f]))*\(/i,s=/(?<![\w-])(?:calc|min|max|clamp|round|mod|rem|abs|sign|pow|sqrt|hypot|log|exp|sin|cos|tan|asin|acos|atan2?)\(/i;function c(e,t){let n=1;for(let r=t;r<e.length;r++){let i=e[r];if(i===`"`||i===`'`||i===`\\`||i===`/`&&e[r+1]===`*`)return;if(i===`(`)n++;else if(i===`)`&&--n===0)return e.slice(t,r)}}function l(e){if(o.test(e))return!0;for(let t of e.matchAll(/cubic-bezier\(/gi)){let n=c(e,t.index+t[0].length);if(n===void 0||s.test(n))return!0}return!1}let u;function d(i,a){if(!l(i))return;let{parse:o,walk:s}=u??=e(import.meta.url)(`css-tree`);s(o(i,{positions:!0,parseValue:!1,parseCustomProperty:!1,parseAtrulePrelude:!1}),{visit:`Declaration`,enter(e){let o=t(e.property).replace(/^-(?:webkit|moz|o)-/,``);if(!r.has(o)||!e.value.loc)return;let{start:s,end:c}=e.value.loc,l=i.slice(s.offset,c.offset),u=n(l);u!==l&&a(s.offset,c.offset,u)}})}export{l as needsEasingEdits,i as prepareEasingCss,a as prepareEasingStylesheet};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teacss/directives",
3
- "version": "0.9.0-alpha.3",
3
+ "version": "0.9.0-alpha.5",
4
4
  "description": "Build-time CSS directive transformer for TeaCSS — @apply, theme(), icon(), and @screen.",
5
5
  "homepage": "https://css.teasim.com",
6
6
  "funding": "https://github.com/sponsors/billgo",
@@ -24,17 +24,17 @@
24
24
  "dev": "tsdown --watch"
25
25
  },
26
26
  "dependencies": {
27
- "@teacss/config": "0.9.0-alpha.3",
28
- "@teacss/core": "0.9.0-alpha.3",
29
- "@teacss/rule-helpers": "0.9.0-alpha.3",
30
- "@teacss/runtime": "0.9.0-alpha.3",
27
+ "@teacss/config": "0.9.0-alpha.5",
28
+ "@teacss/core": "0.9.0-alpha.5",
29
+ "@teacss/rule-helpers": "0.9.0-alpha.5",
30
+ "@teacss/runtime": "0.9.0-alpha.5",
31
31
  "@types/css-tree": "^3.2.0",
32
32
  "css-tree": "^3.2.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@teacss/preset-icons": "0.9.0-alpha.3",
36
- "@teacss/preset-official": "0.9.0-alpha.3",
37
- "@teacss/preset-standard": "0.9.0-alpha.3",
35
+ "@teacss/preset-icons": "0.9.0-alpha.5",
36
+ "@teacss/preset-official": "0.9.0-alpha.5",
37
+ "@teacss/preset-standard": "0.9.0-alpha.5",
38
38
  "magic-string": "^1.2.3"
39
39
  },
40
40
  "engines": {