@tamagui/use-direction 1.14.0 → 1.14.2
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/cjs/index.js +18 -1
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/useDirection.js +53 -1
- package/dist/cjs/useDirection.js.map +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/useDirection.js +17 -1
- package/dist/esm/useDirection.js.map +2 -2
- package/dist/esm/useDirection.mjs +17 -1
- package/dist/esm/useDirection.mjs.map +2 -2
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var src_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(src_exports);
|
|
18
|
+
__reExport(src_exports, require("./useDirection"), module.exports);
|
|
2
19
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './useDirection'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,2BAAd;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/cjs/useDirection.js
CHANGED
|
@@ -1,2 +1,54 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var useDirection_exports = {};
|
|
30
|
+
__export(useDirection_exports, {
|
|
31
|
+
DirectionProvider: () => DirectionProvider,
|
|
32
|
+
Provider: () => Provider,
|
|
33
|
+
useDirection: () => useDirection
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(useDirection_exports);
|
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
37
|
+
var React = __toESM(require("react"));
|
|
38
|
+
const DirectionContext = React.createContext(void 0);
|
|
39
|
+
const DirectionProvider = (props) => {
|
|
40
|
+
const { dir, children } = props;
|
|
41
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DirectionContext.Provider, { value: dir, children });
|
|
42
|
+
};
|
|
43
|
+
function useDirection(localDir) {
|
|
44
|
+
const globalDir = React.useContext(DirectionContext);
|
|
45
|
+
return localDir || globalDir || "ltr";
|
|
46
|
+
}
|
|
47
|
+
const Provider = DirectionProvider;
|
|
48
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
49
|
+
0 && (module.exports = {
|
|
50
|
+
DirectionProvider,
|
|
51
|
+
Provider,
|
|
52
|
+
useDirection
|
|
53
|
+
});
|
|
2
54
|
//# sourceMappingURL=useDirection.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useDirection.tsx"],
|
|
4
4
|
"sourcesContent": ["// forked from https://github.com/radix-ui/primitives/blob/main/packages/react/direction/src/Direction.tsx\n\nimport * as React from 'react'\n\ntype Direction = 'ltr' | 'rtl'\nconst DirectionContext = React.createContext<Direction | undefined>(undefined)\n\ninterface DirectionProviderProps {\n children?: React.ReactNode\n dir: Direction\n}\n\nexport const DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props\n return (\n <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>\n )\n}\n\nexport function useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext)\n return localDir || globalDir || 'ltr'\n}\n\nexport const Provider = DirectionProvider\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeI;AAbJ,YAAuB;AAGvB,MAAM,mBAAmB,MAAM,cAAqC,MAAS;AAOtE,MAAM,oBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SACE,4CAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAErD;AAEO,SAAS,aAAa,UAAsB;AACjD,QAAM,YAAY,MAAM,WAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEO,MAAM,WAAW;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./useDirection";
|
|
1
|
+
export * from "./useDirection";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./useDirection";
|
|
1
|
+
export * from "./useDirection";
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
package/dist/esm/useDirection.js
CHANGED
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const DirectionContext = React.createContext(void 0);
|
|
4
|
+
const DirectionProvider = (props) => {
|
|
5
|
+
const { dir, children } = props;
|
|
6
|
+
return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });
|
|
7
|
+
};
|
|
8
|
+
function useDirection(localDir) {
|
|
9
|
+
const globalDir = React.useContext(DirectionContext);
|
|
10
|
+
return localDir || globalDir || "ltr";
|
|
11
|
+
}
|
|
12
|
+
const Provider = DirectionProvider;
|
|
13
|
+
export {
|
|
14
|
+
DirectionProvider,
|
|
15
|
+
Provider,
|
|
16
|
+
useDirection
|
|
17
|
+
};
|
|
2
18
|
//# sourceMappingURL=useDirection.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useDirection.tsx"],
|
|
4
4
|
"sourcesContent": ["// forked from https://github.com/radix-ui/primitives/blob/main/packages/react/direction/src/Direction.tsx\n\nimport * as React from 'react'\n\ntype Direction = 'ltr' | 'rtl'\nconst DirectionContext = React.createContext<Direction | undefined>(undefined)\n\ninterface DirectionProviderProps {\n children?: React.ReactNode\n dir: Direction\n}\n\nexport const DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props\n return (\n <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>\n )\n}\n\nexport function useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext)\n return localDir || globalDir || 'ltr'\n}\n\nexport const Provider = DirectionProvider\n"],
|
|
5
|
-
"mappings": "AAeI,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAeI;AAbJ,YAAY,WAAW;AAGvB,MAAM,mBAAmB,MAAM,cAAqC,MAAS;AAOtE,MAAM,oBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAErD;AAEO,SAAS,aAAa,UAAsB;AACjD,QAAM,YAAY,MAAM,WAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEO,MAAM,WAAW;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,18 @@
|
|
|
1
|
-
import{jsx
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const DirectionContext = React.createContext(void 0);
|
|
4
|
+
const DirectionProvider = (props) => {
|
|
5
|
+
const { dir, children } = props;
|
|
6
|
+
return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });
|
|
7
|
+
};
|
|
8
|
+
function useDirection(localDir) {
|
|
9
|
+
const globalDir = React.useContext(DirectionContext);
|
|
10
|
+
return localDir || globalDir || "ltr";
|
|
11
|
+
}
|
|
12
|
+
const Provider = DirectionProvider;
|
|
13
|
+
export {
|
|
14
|
+
DirectionProvider,
|
|
15
|
+
Provider,
|
|
16
|
+
useDirection
|
|
17
|
+
};
|
|
2
18
|
//# sourceMappingURL=useDirection.mjs.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useDirection.tsx"],
|
|
4
4
|
"sourcesContent": ["// forked from https://github.com/radix-ui/primitives/blob/main/packages/react/direction/src/Direction.tsx\n\nimport * as React from 'react'\n\ntype Direction = 'ltr' | 'rtl'\nconst DirectionContext = React.createContext<Direction | undefined>(undefined)\n\ninterface DirectionProviderProps {\n children?: React.ReactNode\n dir: Direction\n}\n\nexport const DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props\n return (\n <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>\n )\n}\n\nexport function useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext)\n return localDir || globalDir || 'ltr'\n}\n\nexport const Provider = DirectionProvider\n"],
|
|
5
|
-
"mappings": "AAeI,
|
|
6
|
-
"names": [
|
|
5
|
+
"mappings": "AAeI;AAbJ,YAAY,WAAW;AAGvB,MAAM,mBAAmB,MAAM,cAAqC,MAAS;AAOtE,MAAM,oBAAsD,CAAC,UAAU;AAC5E,QAAM,EAAE,KAAK,SAAS,IAAI;AAC1B,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,KAAM,UAAS;AAErD;AAEO,SAAS,aAAa,UAAsB;AACjD,QAAM,YAAY,MAAM,WAAW,gBAAgB;AACnD,SAAO,YAAY,aAAa;AAClC;AAEO,MAAM,WAAW;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-direction",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tamagui/build": "1.14.
|
|
29
|
+
"@tamagui/build": "1.14.2",
|
|
30
30
|
"react": "^18.2.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|