sdk fixes
This commit is contained in:
@@ -12,9 +12,6 @@ interface KeyValueProps {
|
|||||||
export function KeyValue({ href, onClick, name, value }: KeyValueProps) {
|
export function KeyValue({ href, onClick, name, value }: KeyValueProps) {
|
||||||
const clickable = href || onClick;
|
const clickable = href || onClick;
|
||||||
const Component = href ? (Link as any) : onClick ? 'button' : 'div';
|
const Component = href ? (Link as any) : onClick ? 'button' : 'div';
|
||||||
if (!isValidElement(value)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Component
|
<Component
|
||||||
@@ -40,10 +37,6 @@ export function KeyValue({ href, onClick, name, value }: KeyValueProps) {
|
|||||||
export function KeyValueSubtle({ href, onClick, name, value }: KeyValueProps) {
|
export function KeyValueSubtle({ href, onClick, name, value }: KeyValueProps) {
|
||||||
const clickable = href || onClick;
|
const clickable = href || onClick;
|
||||||
const Component = href ? (Link as any) : onClick ? 'button' : 'div';
|
const Component = href ? (Link as any) : onClick ? 'button' : 'div';
|
||||||
if (!isValidElement(value)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Component
|
<Component
|
||||||
className="group flex text-[10px] sm:text-xs gap-2 font-medium self-start min-w-0 max-w-full items-center"
|
className="group flex text-[10px] sm:text-xs gap-2 font-medium self-start min-w-0 max-w-full items-center"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Constants from 'expo-constants';
|
|||||||
import type { MixanOptions } from '@mixan/sdk';
|
import type { MixanOptions } from '@mixan/sdk';
|
||||||
import { Mixan } from '@mixan/sdk';
|
import { Mixan } from '@mixan/sdk';
|
||||||
|
|
||||||
type MixanNativeOptions = MixanOptions
|
type MixanNativeOptions = MixanOptions;
|
||||||
|
|
||||||
export class MixanNative extends Mixan<MixanNativeOptions> {
|
export class MixanNative extends Mixan<MixanNativeOptions> {
|
||||||
constructor(options: MixanNativeOptions) {
|
constructor(options: MixanNativeOptions) {
|
||||||
|
|||||||
@@ -9,13 +9,13 @@
|
|||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mixan/sdk": "workspace:*",
|
"@mixan/sdk": "workspace:*"
|
||||||
"@mixan/types": "workspace:*"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@mixan/eslint-config": "workspace:*",
|
"@mixan/eslint-config": "workspace:*",
|
||||||
"@mixan/prettier-config": "workspace:*",
|
"@mixan/prettier-config": "workspace:*",
|
||||||
"@mixan/tsconfig": "workspace:*",
|
"@mixan/tsconfig": "workspace:*",
|
||||||
|
"@mixan/types": "workspace:*",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.48.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
|
|||||||
@@ -11,8 +11,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mixan/sdk": "workspace:*",
|
"@mixan/sdk": "workspace:*",
|
||||||
"@mixan/sdk-web": "workspace:*",
|
"@mixan/sdk-web": "workspace:*"
|
||||||
"@mixan/types": "workspace:*"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"next": "^13.0.0"
|
"next": "^13.0.0"
|
||||||
@@ -21,6 +20,7 @@
|
|||||||
"@mixan/eslint-config": "workspace:*",
|
"@mixan/eslint-config": "workspace:*",
|
||||||
"@mixan/prettier-config": "workspace:*",
|
"@mixan/prettier-config": "workspace:*",
|
||||||
"@mixan/tsconfig": "workspace:*",
|
"@mixan/tsconfig": "workspace:*",
|
||||||
|
"@mixan/types": "workspace:*",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.48.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mixan/sdk": "workspace:*",
|
"@mixan/sdk": "workspace:*"
|
||||||
"@mixan/types": "workspace:*"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@mixan/eslint-config": "workspace:*",
|
"@mixan/eslint-config": "workspace:*",
|
||||||
"@mixan/prettier-config": "workspace:*",
|
"@mixan/prettier-config": "workspace:*",
|
||||||
"@mixan/tsconfig": "workspace:*",
|
"@mixan/tsconfig": "workspace:*",
|
||||||
|
"@mixan/types": "workspace:*",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.48.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
|
|||||||
@@ -121,10 +121,6 @@ export class Mixan<Options extends MixanOptions = MixanOptions> {
|
|||||||
|
|
||||||
// Public
|
// Public
|
||||||
|
|
||||||
public init(properties?: Record<string, unknown>) {
|
|
||||||
this.state.properties = properties ?? {};
|
|
||||||
}
|
|
||||||
|
|
||||||
public setProfileId(profileId: string) {
|
public setProfileId(profileId: string) {
|
||||||
this.state.profileId = profileId;
|
this.state.profileId = profileId;
|
||||||
}
|
}
|
||||||
@@ -206,6 +202,7 @@ export class Mixan<Options extends MixanOptions = MixanOptions> {
|
|||||||
public clear() {
|
public clear() {
|
||||||
this.state.properties = {};
|
this.state.properties = {};
|
||||||
this.state.deviceId = undefined;
|
this.state.deviceId = undefined;
|
||||||
|
this.state.profileId = undefined;
|
||||||
if (this.options.removeDeviceId) {
|
if (this.options.removeDeviceId) {
|
||||||
this.options.removeDeviceId();
|
this.options.removeDeviceId();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,12 @@
|
|||||||
"format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
|
"format": "prettier --check \"**/*.{mjs,ts,md,json}\"",
|
||||||
"typecheck": "tsc --noEmit"
|
"typecheck": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {},
|
||||||
"@mixan/types": "workspace:*"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@mixan/eslint-config": "workspace:*",
|
"@mixan/eslint-config": "workspace:*",
|
||||||
"@mixan/prettier-config": "workspace:*",
|
"@mixan/prettier-config": "workspace:*",
|
||||||
"@mixan/tsconfig": "workspace:*",
|
"@mixan/tsconfig": "workspace:*",
|
||||||
|
"@mixan/types": "workspace:*",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.48.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@mixan/eslint-config": "workspace:*",
|
"@mixan/eslint-config": "workspace:*",
|
||||||
"@mixan/prettier-config": "workspace:*",
|
"@mixan/prettier-config": "workspace:*",
|
||||||
|
"@mixan/tsconfig": "workspace:*",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.48.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.0.3",
|
||||||
"tsup": "^7.2.0",
|
"tsup": "^7.2.0",
|
||||||
|
|||||||
@@ -1,19 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"extends": "@mixan/tsconfig/sdk.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["ESNext"],
|
"outDir": "dist"
|
||||||
"module": "esnext",
|
|
||||||
"target": "esnext",
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"noEmit": true,
|
|
||||||
"composite": true,
|
|
||||||
"strict": true,
|
|
||||||
"downlevelIteration": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"allowJs": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { defineConfig } from 'tsup';
|
||||||
|
|
||||||
|
import config from '@mixan/tsconfig/tsup.config.json' assert { type: 'json' };
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
entry: ['index.ts'],
|
...(config as any),
|
||||||
format: ['cjs', 'esm'], // Build for commonJS and ESmodules
|
entry: ['index.ts', 'cdn.ts'],
|
||||||
dts: true, // Generate declaration file (.d.ts)
|
format: ['cjs', 'esm', 'iife'],
|
||||||
splitting: false,
|
|
||||||
sourcemap: false,
|
|
||||||
clean: true,
|
|
||||||
});
|
});
|
||||||
|
|||||||
28
pnpm-lock.yaml
generated
28
pnpm-lock.yaml
generated
@@ -865,10 +865,6 @@ importers:
|
|||||||
version: 5.3.3
|
version: 5.3.3
|
||||||
|
|
||||||
packages/sdk:
|
packages/sdk:
|
||||||
dependencies:
|
|
||||||
'@mixan/types':
|
|
||||||
specifier: workspace:*
|
|
||||||
version: link:../types
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@mixan/eslint-config':
|
'@mixan/eslint-config':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
@@ -879,6 +875,9 @@ importers:
|
|||||||
'@mixan/tsconfig':
|
'@mixan/tsconfig':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../tooling/typescript
|
version: link:../../tooling/typescript
|
||||||
|
'@mixan/types':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../types
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.48.0
|
specifier: ^8.48.0
|
||||||
version: 8.56.0
|
version: 8.56.0
|
||||||
@@ -897,9 +896,6 @@ importers:
|
|||||||
'@mixan/sdk':
|
'@mixan/sdk':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../sdk
|
version: link:../sdk
|
||||||
'@mixan/types':
|
|
||||||
specifier: workspace:*
|
|
||||||
version: link:../types
|
|
||||||
expo-application:
|
expo-application:
|
||||||
specifier: ~5.3.0
|
specifier: ~5.3.0
|
||||||
version: 5.3.1(expo@50.0.7)
|
version: 5.3.1(expo@50.0.7)
|
||||||
@@ -919,6 +915,9 @@ importers:
|
|||||||
'@mixan/tsconfig':
|
'@mixan/tsconfig':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../tooling/typescript
|
version: link:../../tooling/typescript
|
||||||
|
'@mixan/types':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../types
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.48.0
|
specifier: ^8.48.0
|
||||||
version: 8.56.0
|
version: 8.56.0
|
||||||
@@ -940,9 +939,6 @@ importers:
|
|||||||
'@mixan/sdk-web':
|
'@mixan/sdk-web':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../sdk-web
|
version: link:../sdk-web
|
||||||
'@mixan/types':
|
|
||||||
specifier: workspace:*
|
|
||||||
version: link:../types
|
|
||||||
next:
|
next:
|
||||||
specifier: ^13.0.0
|
specifier: ^13.0.0
|
||||||
version: 13.4.19(react-dom@18.2.0)(react@18.2.0)
|
version: 13.4.19(react-dom@18.2.0)(react@18.2.0)
|
||||||
@@ -956,6 +952,9 @@ importers:
|
|||||||
'@mixan/tsconfig':
|
'@mixan/tsconfig':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../tooling/typescript
|
version: link:../../tooling/typescript
|
||||||
|
'@mixan/types':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../types
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.48.0
|
specifier: ^8.48.0
|
||||||
version: 8.56.0
|
version: 8.56.0
|
||||||
@@ -974,9 +973,6 @@ importers:
|
|||||||
'@mixan/sdk':
|
'@mixan/sdk':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../sdk
|
version: link:../sdk
|
||||||
'@mixan/types':
|
|
||||||
specifier: workspace:*
|
|
||||||
version: link:../types
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@mixan/eslint-config':
|
'@mixan/eslint-config':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
@@ -987,6 +983,9 @@ importers:
|
|||||||
'@mixan/tsconfig':
|
'@mixan/tsconfig':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../tooling/typescript
|
version: link:../../tooling/typescript
|
||||||
|
'@mixan/types':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../types
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.48.0
|
specifier: ^8.48.0
|
||||||
version: 8.56.0
|
version: 8.56.0
|
||||||
@@ -1008,6 +1007,9 @@ importers:
|
|||||||
'@mixan/prettier-config':
|
'@mixan/prettier-config':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../tooling/prettier
|
version: link:../../tooling/prettier
|
||||||
|
'@mixan/tsconfig':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../tooling/typescript
|
||||||
eslint:
|
eslint:
|
||||||
specifier: ^8.48.0
|
specifier: ^8.48.0
|
||||||
version: 8.56.0
|
version: 8.56.0
|
||||||
|
|||||||
Reference in New Issue
Block a user