@trypattern/sdk 0.1.16 → 0.1.18

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.
@@ -11,6 +11,7 @@ type ScrollAreaProps = {
11
11
  paddingInline?: number | string;
12
12
  }>;
13
13
  axis?: 'vertical' | 'horizontal';
14
+ resetOn?: string;
14
15
  };
15
- export declare function ScrollArea({ children, style, axis }: ScrollAreaProps): import("react").JSX.Element;
16
+ export declare function ScrollArea({ children, style, axis, resetOn }: ScrollAreaProps): import("react").JSX.Element;
16
17
  export {};
@@ -1,7 +1,12 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as stylex from '@stylexjs/stylex';
3
- export function ScrollArea({ children, style, axis = 'vertical' }) {
4
- return (_jsx("div", { ...stylex.props(styles.scroll, axis === 'horizontal' && styles.horizontal, style), children: children }));
3
+ import { useLayoutEffect, useRef } from 'react';
4
+ export function ScrollArea({ children, style, axis = 'vertical', resetOn }) {
5
+ const area = useRef(null);
6
+ useLayoutEffect(() => {
7
+ area.current?.scrollTo({ top: 0, left: 0 });
8
+ }, [resetOn]);
9
+ return (_jsx("div", { ref: area, ...stylex.props(styles.scroll, axis === 'horizontal' && styles.horizontal, style), children: children }));
5
10
  }
6
11
  const styles = stylex.create({
7
12
  scroll: {
@@ -149,7 +149,7 @@ export declare const connection: z.ZodObject<{
149
149
  connectedAt: z.ZodString;
150
150
  }, z.core.$strip>;
151
151
  export type Connection = z.output<typeof connection>;
152
- export declare const DOMAIN_ENDINGS: readonly ["com", "ca", "co", "org", "net", "app", "dev", "shop"];
152
+ export declare const DOMAIN_ENDINGS: readonly ["com", "co", "org", "net", "app", "dev", "shop"];
153
153
  export declare const DOMAIN_PRICE_LIMIT_USD = 30;
154
154
  export declare const domainName: z.ZodString;
155
155
  export declare const domainChoice: z.ZodObject<{
@@ -185,7 +185,6 @@ export const connection = z.object({
185
185
  });
186
186
  export const DOMAIN_ENDINGS = [
187
187
  'com',
188
- 'ca',
189
188
  'co',
190
189
  'org',
191
190
  'net',
@@ -20,7 +20,8 @@ const APP_PATH = '/api/app';
20
20
  function knowAdmins(admins) {
21
21
  const emails = adminEmails(admins);
22
22
  return (c, next) => {
23
- c.set('admins', emails);
23
+ const owner = c.env.OWNER_EMAIL?.trim().toLowerCase() ?? '';
24
+ c.set('admins', owner === '' ? emails : new Set([...emails, owner]));
24
25
  return next();
25
26
  };
26
27
  }
@@ -7,6 +7,7 @@ export type ServerBindings = {
7
7
  DB: D1Database;
8
8
  SESSION_SECRET: string;
9
9
  AUTH_SECRET?: string;
10
+ OWNER_EMAIL?: string;
10
11
  MEDIA?: R2Bucket;
11
12
  ASSETS?: Fetcher;
12
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trypattern/sdk",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",