@weapp-tailwindcss/runtime 0.1.10 → 0.1.11

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.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let clsx = require("clsx");
3
- let _weapp_core_escape = require("@weapp-core/escape");
3
+ let _weapp_tailwindcss_escape = require("@weapp-tailwindcss/escape");
4
4
  //#region src/transformer-probes.ts
5
5
  const probes = /* @__PURE__ */ new WeakMap();
6
6
  const unescapePattern = /u[0-9a-f]{3,}/i;
7
- const escapeNeedles = Object.keys(_weapp_core_escape.MappingChars2String).filter(Boolean);
7
+ const escapeNeedles = Object.keys(_weapp_tailwindcss_escape.MappingChars2String).filter(Boolean);
8
8
  /** 仅为已知默认转换器登记可证明安全的跳过条件,不改变公开类型。 */
9
9
  function registerTransformProbe(transform, direction) {
10
10
  probes.set(transform, direction === "identity" ? () => false : direction === "unescape" ? (value) => value.includes("_") || unescapePattern.test(value) : (value) => escapeNeedles.some((needle) => value.includes(needle)));
@@ -22,9 +22,9 @@ function isConfig(value) {
22
22
  }
23
23
  function mergeWithDefaultMap(map) {
24
24
  if (!map) return;
25
- if (map === _weapp_core_escape.MappingChars2String) return _weapp_core_escape.MappingChars2String;
25
+ if (map === _weapp_tailwindcss_escape.MappingChars2String) return _weapp_tailwindcss_escape.MappingChars2String;
26
26
  return {
27
- ..._weapp_core_escape.MappingChars2String,
27
+ ..._weapp_tailwindcss_escape.MappingChars2String,
28
28
  ...map
29
29
  };
30
30
  }
@@ -32,7 +32,7 @@ function resolveSharedMap(options) {
32
32
  const { escape, unescape } = options ?? {};
33
33
  if (isConfig(escape) && escape.map) return mergeWithDefaultMap(escape.map);
34
34
  if (isConfig(unescape) && unescape.map) return mergeWithDefaultMap(unescape.map);
35
- return _weapp_core_escape.MappingChars2String;
35
+ return _weapp_tailwindcss_escape.MappingChars2String;
36
36
  }
37
37
  function resolveTransformers(options) {
38
38
  const sharedMap = resolveSharedMap(options);
@@ -56,9 +56,9 @@ function resolveTransformers(options) {
56
56
  };
57
57
  else unescapeOptions = { map: sharedMap };
58
58
  }
59
- const escapeFn = escapeEnabled ? (value) => (0, _weapp_core_escape.escape)(value, escapeOptions) : identity;
60
- const unescapeFn = unescapeEnabled ? (value) => (0, _weapp_core_escape.unescape)(value, unescapeOptions) : identity;
61
- if (sharedMap === _weapp_core_escape.MappingChars2String) {
59
+ const escapeFn = escapeEnabled ? (value) => (0, _weapp_tailwindcss_escape.escape)(value, escapeOptions) : identity;
60
+ const unescapeFn = unescapeEnabled ? (value) => (0, _weapp_tailwindcss_escape.unescape)(value, unescapeOptions) : identity;
61
+ if (sharedMap === _weapp_tailwindcss_escape.MappingChars2String) {
62
62
  if (escapeEnabled && !isConfig(escapeConfig)) registerTransformProbe(escapeFn, "escape");
63
63
  if (unescapeEnabled && !isConfig(unescapeConfig)) registerTransformProbe(unescapeFn, "unescape");
64
64
  }
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ClassValue, ClassValue as ClassValue$1, clsx as clsxFn } from "clsx";
2
- import { EscapeOptions, UnescapeOptions } from "@weapp-core/escape";
2
+ import { EscapeOptions, UnescapeOptions } from "@weapp-tailwindcss/escape";
3
3
  //#region src/types.d.ts
4
4
  type EscapeConfig = boolean | EscapeOptions;
5
5
  type UnescapeConfig = boolean | UnescapeOptions;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ClassValue, ClassValue as ClassValue$1, clsx as clsxFn } from "clsx";
2
- import { EscapeOptions, UnescapeOptions } from "@weapp-core/escape";
2
+ import { EscapeOptions, UnescapeOptions } from "@weapp-tailwindcss/escape";
3
3
  //#region src/types.d.ts
4
4
  type EscapeConfig = boolean | EscapeOptions;
5
5
  type UnescapeConfig = boolean | UnescapeOptions;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { clsx, clsx as clsxFn } from "clsx";
2
- import { MappingChars2String, escape, unescape } from "@weapp-core/escape";
2
+ import { MappingChars2String, escape, unescape } from "@weapp-tailwindcss/escape";
3
3
  //#region src/transformer-probes.ts
4
4
  const probes = /* @__PURE__ */ new WeakMap();
5
5
  const unescapePattern = /u[0-9a-f]{3,}/i;
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/runtime",
3
3
  "type": "module",
4
- "version": "0.1.10",
4
+ "version": "0.1.11",
5
5
  "description": "Shared runtime adapters for cross-platform Tailwind CSS class utilities. 跨端 Tailwind CSS 类名工具的共享运行时适配层。",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
8
8
  "homepage": "https://tw.weapp.dev/docs/community/merge/runtime-api",
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "git+https://github.com/sonofmagic/weapp-tailwindcss.git",
11
+ "url": "git+https://github.com/weapp-tailwindcss/weapp-tailwindcss.git",
12
12
  "directory": "packages-runtime/runtime"
13
13
  },
14
14
  "bugs": {
15
- "url": "https://github.com/sonofmagic/weapp-tailwindcss/issues"
15
+ "url": "https://github.com/weapp-tailwindcss/weapp-tailwindcss/issues"
16
16
  },
17
17
  "keywords": [
18
18
  "tailwindcss",
@@ -46,7 +46,7 @@
46
46
  "access": "public"
47
47
  },
48
48
  "dependencies": {
49
- "@weapp-core/escape": "^8.0.0",
49
+ "@weapp-tailwindcss/escape": "0.0.2",
50
50
  "clsx": "^2.1.1"
51
51
  },
52
52
  "scripts": {