@tamagui/image 1.0.1-beta.75 → 1.0.1-beta.78

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/esm/Image.js CHANGED
@@ -1,3 +1,34 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
1
32
  import { getExpandedShorthands, isWeb, styled } from "@tamagui/core";
2
33
  import React from "react";
3
34
  import { Image as RNImage } from "react-native";
@@ -12,18 +43,16 @@ const StyledImage = styled(RNImage, {
12
43
  });
13
44
  const Image = StyledImage.extractable((inProps) => {
14
45
  const props = getExpandedShorthands(inProps);
15
- const { src, width = 100, height = 100, ...rest } = props;
16
- const source = typeof src === "string" ? { uri: src, ...isWeb && { width, height } } : src;
46
+ const _a = props, { src, width = 100, height = 100 } = _a, rest = __objRest(_a, ["src", "width", "height"]);
47
+ const source = typeof src === "string" ? __spreadValues({ uri: src }, isWeb && { width, height }) : src;
17
48
  const defaultSource = Array.isArray(source) ? source[0] : source;
18
49
  if (!defaultSource) {
19
50
  return null;
20
51
  }
21
- return /* @__PURE__ */ React.createElement(StyledImage, {
22
- ...!isWeb && { style: { width, height } },
52
+ return /* @__PURE__ */ React.createElement(StyledImage, __spreadValues(__spreadProps(__spreadValues({}, !isWeb && { style: { width, height } }), {
23
53
  defaultSource,
24
- source,
25
- ...rest
26
- });
54
+ source
55
+ }), rest));
27
56
  });
28
57
  export {
29
58
  Image
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/Image.tsx"],
4
4
  "sourcesContent": ["import { GetProps, StackProps, getExpandedShorthands, isWeb, styled } from '@tamagui/core'\nimport React from 'react'\nimport { Image as RNImage } from 'react-native'\n\nReact['createElement']\n\nconst StyledImage = styled(\n RNImage,\n {\n name: 'Image',\n position: 'relative',\n source: { uri: '' },\n zIndex: 1,\n },\n {\n inlineProps: new Set(['src', 'width', 'height']),\n }\n)\n\ntype StyledImageProps = GetProps<typeof StyledImage>\n\ntype BaseProps = Omit<StyledImageProps, 'source' | 'width' | 'height' | 'style' | 'onLayout'> & {\n width: number\n height: number\n src: string | StyledImageProps['source']\n}\n\nexport type ImageProps = BaseProps & Omit<StackProps, keyof BaseProps>\n\nexport const Image: React.FC<ImageProps> = StyledImage.extractable((inProps) => {\n const props = getExpandedShorthands(inProps)\n const { src, width = 100, height = 100, ...rest } = props\n const source = typeof src === 'string' ? { uri: src, ...(isWeb && { width, height }) } : src\n const defaultSource = Array.isArray(source) ? source[0] : source\n\n if (!defaultSource) {\n // placeholder with customizability\n return null\n }\n\n // must set defaultSource to allow SSR, default it to the same as src\n return (\n <StyledImage\n {...(!isWeb && { style: { width, height } })}\n defaultS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AM,SAAS,OAAO,QAAQ,WAAW,iBAAE,KAAK,OAAS,SAAS,EAAE,OAAO,OAAO,KAAO;AACzF,QAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,OAAO,KAAK;AAE1D,MAAI,CAAC,eAAe;AAElB,WAAO;AAAA,EACT;AAGA,SACE,oCAAC,6DACM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,OAAO,EAAE,IAD3C;AAAA,IAEC;AAAA,IACA;AAAA,MACK,KACP;AAEJ,CAAC;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/image",
3
- "version": "1.0.1-beta.75",
3
+ "version": "1.0.1-beta.78",
4
4
  "sideEffects": [
5
5
  "*.css"
6
6
  ],
@@ -21,14 +21,14 @@
21
21
  "clean:build": "tamagui-build clean:build"
22
22
  },
23
23
  "dependencies": {
24
- "@tamagui/core": "^1.0.1-beta.75"
24
+ "@tamagui/core": "^1.0.1-beta.78"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "*",
28
28
  "react-native": "*"
29
29
  },
30
30
  "devDependencies": {
31
- "@tamagui/build": "^1.0.1-beta.75",
31
+ "@tamagui/build": "^1.0.1-beta.78",
32
32
  "react": "*",
33
33
  "react-native": "*"
34
34
  },