@timpel/forumkit-sdk-web 0.1.0 → 0.2.1

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.
@@ -19,6 +19,14 @@ declare const ForumKit: vue.DefineComponent<vue.ExtractPropTypes<{
19
19
  type: StringConstructor;
20
20
  default: undefined;
21
21
  };
22
+ platform: {
23
+ type: PropType<"web" | "native">;
24
+ default: undefined;
25
+ };
26
+ onLogout: {
27
+ type: PropType<() => void>;
28
+ default: undefined;
29
+ };
22
30
  class: {
23
31
  type: StringConstructor;
24
32
  default: undefined;
@@ -40,6 +48,14 @@ declare const ForumKit: vue.DefineComponent<vue.ExtractPropTypes<{
40
48
  type: StringConstructor;
41
49
  default: undefined;
42
50
  };
51
+ platform: {
52
+ type: PropType<"web" | "native">;
53
+ default: undefined;
54
+ };
55
+ onLogout: {
56
+ type: PropType<() => void>;
57
+ default: undefined;
58
+ };
43
59
  class: {
44
60
  type: StringConstructor;
45
61
  default: undefined;
@@ -47,6 +63,8 @@ declare const ForumKit: vue.DefineComponent<vue.ExtractPropTypes<{
47
63
  }>> & Readonly<{}>, {
48
64
  theme: ThemeTokens;
49
65
  apiUrl: string;
66
+ platform: "web" | "native";
67
+ onLogout: () => void;
50
68
  class: string;
51
69
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
52
70
 
@@ -1,5 +1,5 @@
1
- import "../chunk-FASHQ6GM.js";
2
- import "../chunk-YICVG5QM.js";
1
+ import "../chunk-EJQY26NT.js";
2
+ import "../chunk-2UVRYLED.js";
3
3
 
4
4
  // src/wrappers/vue.ts
5
5
  import { defineComponent, h, onMounted, watchEffect, ref } from "vue";
@@ -10,6 +10,8 @@ var ForumKit = defineComponent({
10
10
  token: { type: String, required: true },
11
11
  theme: { type: Object, default: void 0 },
12
12
  apiUrl: { type: String, default: void 0 },
13
+ platform: { type: String, default: void 0 },
14
+ onLogout: { type: Function, default: void 0 },
13
15
  class: { type: String, default: void 0 }
14
16
  },
15
17
  setup(props) {
@@ -29,6 +31,12 @@ var ForumKit = defineComponent({
29
31
  } else {
30
32
  el.removeAttribute("api-url");
31
33
  }
34
+ if (props.platform !== void 0) {
35
+ el.setAttribute("platform", props.platform);
36
+ } else {
37
+ el.removeAttribute("platform");
38
+ }
39
+ el.onLogout = props.onLogout;
32
40
  }
33
41
  onMounted(applyProps);
34
42
  watchEffect(applyProps);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/wrappers/vue.ts"],"sourcesContent":["import { defineComponent, h, onMounted, watchEffect, ref, type PropType } from 'vue';\nimport type { ThemeTokens } from '@forumkit/types';\nimport '../components/forum-kit';\n\nexport const ForumKit = defineComponent({\n name: 'ForumKit',\n props: {\n forumId: { type: String, required: true },\n token: { type: String, required: true },\n theme: { type: Object as PropType<ThemeTokens>, default: undefined },\n apiUrl: { type: String, default: undefined },\n class: { type: String, default: undefined },\n },\n setup(props) {\n const elRef = ref<HTMLElement | null>(null);\n\n function applyProps(): void {\n const el = elRef.value;\n if (!el) return;\n el.setAttribute('forum-id', props.forumId);\n el.setAttribute('token', props.token);\n if (props.theme !== undefined) {\n el.setAttribute('theme', JSON.stringify(props.theme));\n } else {\n el.removeAttribute('theme');\n }\n if (props.apiUrl !== undefined) {\n el.setAttribute('api-url', props.apiUrl);\n } else {\n el.removeAttribute('api-url');\n }\n }\n\n onMounted(applyProps);\n watchEffect(applyProps);\n\n return (): ReturnType<typeof h> => h('forum-kit', { ref: elRef, class: props.class });\n },\n});\n"],"mappings":";;;;AAAA,SAAS,iBAAiB,GAAG,WAAW,aAAa,WAA0B;AAIxE,IAAM,WAAW,gBAAgB;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,IACL,SAAS,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACxC,OAAS,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACxC,OAAS,EAAE,MAAM,QAAiC,SAAS,OAAU;AAAA,IACrE,QAAS,EAAE,MAAM,QAAQ,SAAS,OAAU;AAAA,IAC5C,OAAS,EAAE,MAAM,QAAQ,SAAS,OAAU;AAAA,EAC9C;AAAA,EACA,MAAM,OAAO;AACX,UAAM,QAAQ,IAAwB,IAAI;AAE1C,aAAS,aAAmB;AAC1B,YAAM,KAAK,MAAM;AACjB,UAAI,CAAC,GAAI;AACT,SAAG,aAAa,YAAY,MAAM,OAAO;AACzC,SAAG,aAAa,SAAS,MAAM,KAAK;AACpC,UAAI,MAAM,UAAU,QAAW;AAC7B,WAAG,aAAa,SAAS,KAAK,UAAU,MAAM,KAAK,CAAC;AAAA,MACtD,OAAO;AACL,WAAG,gBAAgB,OAAO;AAAA,MAC5B;AACA,UAAI,MAAM,WAAW,QAAW;AAC9B,WAAG,aAAa,WAAW,MAAM,MAAM;AAAA,MACzC,OAAO;AACL,WAAG,gBAAgB,SAAS;AAAA,MAC9B;AAAA,IACF;AAEA,cAAU,UAAU;AACpB,gBAAY,UAAU;AAEtB,WAAO,MAA4B,EAAE,aAAa,EAAE,KAAK,OAAO,OAAO,MAAM,MAAM,CAAC;AAAA,EACtF;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../src/wrappers/vue.ts"],"sourcesContent":["import { defineComponent, h, onMounted, watchEffect, ref, type PropType } from 'vue';\nimport type { ThemeTokens } from '@forumkit/types';\nimport type { ForumKitElement } from '../components/forum-kit';\nimport '../components/forum-kit';\n\nexport const ForumKit = defineComponent({\n name: 'ForumKit',\n props: {\n forumId: { type: String, required: true },\n token: { type: String, required: true },\n theme: { type: Object as PropType<ThemeTokens>, default: undefined },\n apiUrl: { type: String, default: undefined },\n platform: { type: String as PropType<'web' | 'native'>, default: undefined },\n onLogout: { type: Function as PropType<() => void>, default: undefined },\n class: { type: String, default: undefined },\n },\n setup(props) {\n const elRef = ref<ForumKitElement | null>(null);\n\n function applyProps(): void {\n const el = elRef.value;\n if (!el) return;\n el.setAttribute('forum-id', props.forumId);\n el.setAttribute('token', props.token);\n if (props.theme !== undefined) {\n el.setAttribute('theme', JSON.stringify(props.theme));\n } else {\n el.removeAttribute('theme');\n }\n if (props.apiUrl !== undefined) {\n el.setAttribute('api-url', props.apiUrl);\n } else {\n el.removeAttribute('api-url');\n }\n if (props.platform !== undefined) {\n el.setAttribute('platform', props.platform);\n } else {\n el.removeAttribute('platform');\n }\n el.onLogout = props.onLogout;\n }\n\n onMounted(applyProps);\n watchEffect(applyProps);\n\n return (): ReturnType<typeof h> => h('forum-kit', { ref: elRef, class: props.class });\n },\n});\n"],"mappings":";;;;AAAA,SAAS,iBAAiB,GAAG,WAAW,aAAa,WAA0B;AAKxE,IAAM,WAAW,gBAAgB;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,IACL,SAAS,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACxC,OAAS,EAAE,MAAM,QAAQ,UAAU,KAAK;AAAA,IACxC,OAAS,EAAE,MAAM,QAAiC,SAAS,OAAU;AAAA,IACrE,QAAS,EAAE,MAAM,QAAQ,SAAS,OAAU;AAAA,IAC5C,UAAU,EAAE,MAAM,QAAsC,SAAS,OAAU;AAAA,IAC3E,UAAU,EAAE,MAAM,UAAkC,SAAS,OAAU;AAAA,IACvE,OAAS,EAAE,MAAM,QAAQ,SAAS,OAAU;AAAA,EAC9C;AAAA,EACA,MAAM,OAAO;AACX,UAAM,QAAQ,IAA4B,IAAI;AAE9C,aAAS,aAAmB;AAC1B,YAAM,KAAK,MAAM;AACjB,UAAI,CAAC,GAAI;AACT,SAAG,aAAa,YAAY,MAAM,OAAO;AACzC,SAAG,aAAa,SAAS,MAAM,KAAK;AACpC,UAAI,MAAM,UAAU,QAAW;AAC7B,WAAG,aAAa,SAAS,KAAK,UAAU,MAAM,KAAK,CAAC;AAAA,MACtD,OAAO;AACL,WAAG,gBAAgB,OAAO;AAAA,MAC5B;AACA,UAAI,MAAM,WAAW,QAAW;AAC9B,WAAG,aAAa,WAAW,MAAM,MAAM;AAAA,MACzC,OAAO;AACL,WAAG,gBAAgB,SAAS;AAAA,MAC9B;AACA,UAAI,MAAM,aAAa,QAAW;AAChC,WAAG,aAAa,YAAY,MAAM,QAAQ;AAAA,MAC5C,OAAO;AACL,WAAG,gBAAgB,UAAU;AAAA,MAC/B;AACA,SAAG,WAAW,MAAM;AAAA,IACtB;AAEA,cAAU,UAAU;AACpB,gBAAY,UAAU;AAEtB,WAAO,MAA4B,EAAE,aAAa,EAAE,KAAK,OAAO,OAAO,MAAM,MAAM,CAAC;AAAA,EACtF;AACF,CAAC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timpel/forumkit-sdk-web",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -72,8 +72,8 @@
72
72
  "@forumkit/types": "*",
73
73
  "@types/react": "^19.0.0",
74
74
  "@types/react-dom": "^19.0.0",
75
- "react": "^19.2.7",
76
- "react-dom": "^19.2.7",
75
+ "react": "^19.2.8",
76
+ "react-dom": "^19.2.8",
77
77
  "tsup": "^8.5.1",
78
78
  "typescript": "^5.5.0",
79
79
  "vite": "^8.1.0",