ag-common 0.0.674 → 0.0.676

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.
@@ -1,6 +1,7 @@
1
1
  import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';
2
+ import type { AwsCredentialIdentity } from '@smithy/types';
2
3
  import type { IQueryDynamo, Key } from '../types';
3
- export declare const setDynamo: (region: string) => DynamoDBDocument;
4
+ export declare const setDynamo: (region: string, credentials?: AwsCredentialIdentity) => DynamoDBDocument;
4
5
  export declare let dynamoDb: DynamoDBDocument;
5
6
  export declare const putDynamo: <T extends Record<string, any>>(item: T, tableName: string, opt?: {
6
7
  /** if provided, will assert this PK value doesnt already exist */
@@ -22,11 +22,12 @@ const async_1 = require("../../common/helpers/async");
22
22
  const log_1 = require("../../common/helpers/log");
23
23
  const sleep_1 = require("../../common/helpers/sleep");
24
24
  const trim_1 = require("../../common/helpers/string/trim");
25
- const setDynamo = (region) => {
26
- let raw = new client_dynamodb_1.DynamoDBClient({ region });
25
+ const setDynamo = (region, credentials) => {
26
+ let raw = new client_dynamodb_1.DynamoDBClient({ region, credentials });
27
27
  const ddbDocClient = lib_dynamodb_1.DynamoDBDocument.from(raw, {
28
28
  marshallOptions: { removeUndefinedValues: true },
29
29
  });
30
+ exports.dynamoDb = ddbDocClient;
30
31
  return ddbDocClient;
31
32
  };
32
33
  exports.setDynamo = setDynamo;
@@ -10,4 +10,4 @@ export interface IImage {
10
10
  /** if true is counted as a small image, and will be sized accordingly. default false */
11
11
  small?: boolean;
12
12
  }
13
- export declare const Image: (p: ImgHTMLAttributes<HTMLImageElement> & IImage) => React.JSX.Element;
13
+ export declare const Image: (p: ImgHTMLAttributes<HTMLImageElement> & IImage) => React.JSX.Element | null;
@@ -1,5 +1,28 @@
1
1
  "use strict";
2
2
  'use client';
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
3
26
  var __rest = (this && this.__rest) || function (s, e) {
4
27
  var t = {};
5
28
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -17,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
40
  Object.defineProperty(exports, "__esModule", { value: true });
18
41
  exports.Image = void 0;
19
42
  const styled_1 = __importDefault(require("@emotion/styled"));
20
- const react_1 = __importDefault(require("react"));
43
+ const react_1 = __importStar(require("react"));
21
44
  const media_1 = require("../../styles/media");
22
45
  const Base = styled_1.default.img `
23
46
  object-fit: contain;
@@ -62,6 +85,10 @@ const Base = styled_1.default.img `
62
85
  `;
63
86
  const Image = (p) => {
64
87
  const { smalltop, bigonly, smallonly, small } = p, p1 = __rest(p, ["smalltop", "bigonly", "smallonly", "small"]);
65
- return (react_1.default.createElement(Base, Object.assign({}, p1, { "data-smalltop": smalltop, "data-bigonly": bigonly, "data-smallonly": smallonly, "data-small": small })));
88
+ const [display, setDisplay] = (0, react_1.useState)(true);
89
+ if (!display) {
90
+ return null;
91
+ }
92
+ return (react_1.default.createElement(Base, Object.assign({}, p1, { "data-smalltop": smalltop, "data-bigonly": bigonly, "data-smallonly": smallonly, "data-small": small, onError: () => setDisplay(false) })));
66
93
  };
67
94
  exports.Image = Image;
@@ -126,17 +126,17 @@ const Toast = ({ toast, close, style, }) => {
126
126
  return () => clearTimeout(timeout);
127
127
  // eslint-disable-next-line react-hooks/exhaustive-deps
128
128
  }, []);
129
+ const closeStyle = { color: style.color, '--bg': style.borderColor };
130
+ const toastStyle = Object.assign(Object.assign({}, style), { boxShadow: `hsl(from ${style.borderColor} h s 25%) 0px 7px 29px 0px` });
129
131
  if (toast.type === 'standard') {
130
- const st = { color: style.color, '--bg': style.borderColor };
131
- return (react_1.default.createElement(ToastStyle, { style: style },
132
- react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: st }, "\u00D7"),
132
+ return (react_1.default.createElement(ToastStyle, { style: toastStyle },
133
+ react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: closeStyle }, "\u00D7"),
133
134
  react_1.default.createElement(Icon, { style: { fill: style.color } }, icon),
134
135
  toast.message,
135
136
  closeMs !== undefined && (react_1.default.createElement(ProgressBarStyled, { max: 100, min: 0, dotPercentages: null, transitionToMs: closeMs }))));
136
137
  }
137
- const st = { color: style.color, '--bg': style.borderColor };
138
- return (react_1.default.createElement(ToastStyle, { style: style },
139
- react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: st }, "\u00D7"),
138
+ return (react_1.default.createElement(ToastStyle, { style: toastStyle },
139
+ react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: closeStyle }, "\u00D7"),
140
140
  react_1.default.createElement(FlexRow_1.FlexRow, { noWrap: true, center: true },
141
141
  toast.icon === undefined && react_1.default.createElement(Icon, null, icon),
142
142
  toast.icon,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.674",
2
+ "version": "0.0.676",
3
3
  "name": "ag-common",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
@@ -45,25 +45,26 @@
45
45
  "@emotion/react": "11.11.4",
46
46
  "@emotion/styled": "11.11.0",
47
47
  "@smithy/types": "2.12.0",
48
- "@storybook/addon-actions": "7.6.17",
49
- "@storybook/addon-docs": "7.6.17",
50
- "@storybook/addon-essentials": "7.6.17",
51
- "@storybook/addon-interactions": "7.6.17",
52
- "@storybook/addon-links": "7.6.17",
48
+ "@storybook/addon-actions": "8.0.4",
49
+ "@storybook/addon-docs": "8.0.4",
50
+ "@storybook/addon-essentials": "8.0.4",
51
+ "@storybook/addon-interactions": "8.0.4",
52
+ "@storybook/addon-links": "8.0.4",
53
+ "@storybook/addon-webpack5-compiler-swc": "1.0.2",
53
54
  "@storybook/addons": "7.6.17",
54
- "@storybook/react": "7.6.17",
55
- "@storybook/react-webpack5": "7.6.17",
56
- "@storybook/theming": "7.6.17",
55
+ "@storybook/react": "8.0.4",
56
+ "@storybook/react-webpack5": "8.0.4",
57
+ "@storybook/theming": "8.0.4",
57
58
  "@types/jsonwebtoken": "9.0.6",
58
59
  "@types/node": "20.11.30",
59
60
  "@types/react": "18.2.67",
60
61
  "@types/react-dom": "18.2.22",
61
62
  "cross-env": "7.0.3",
62
63
  "eslint-config-e7npm": "0.0.93",
63
- "globstar": "^1.0.0",
64
+ "globstar": "1.0.0",
64
65
  "rimraf": "5.0.5",
65
- "storybook": "7.6.17",
66
- "tsx": "^4.7.0"
66
+ "storybook": "8.0.4",
67
+ "tsx": "4.7.0"
67
68
  },
68
69
  "files": [
69
70
  "dist/**/*",