@mujian/js-sdk 0.0.6-beta.49 → 0.0.6-beta.49-0.4custom-css

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/index.js CHANGED
@@ -187,6 +187,14 @@ class MujianSdk {
187
187
  this.parent = parent;
188
188
  Log.i('mujian sdk client init');
189
189
  await this.call(events_EVENT.MUJIAN_INIT);
190
+ const projectInfo = await this.ai.chat.project.getInfo();
191
+ if (projectInfo.config?.customCss) {
192
+ const style = document.createElement('style');
193
+ style.setAttribute('type', 'text/css');
194
+ style.setAttribute('id', 'mujian-custom-css');
195
+ style.textContent = projectInfo.config.customCss;
196
+ document.head.appendChild(style);
197
+ }
190
198
  } catch (error) {
191
199
  Log.e('init error', error);
192
200
  }
@@ -378,6 +386,14 @@ class src_MujianSdk {
378
386
  this.parent = parent;
379
387
  Log.i('mujian sdk client init');
380
388
  await this.call(events_EVENT.MUJIAN_INIT);
389
+ const projectInfo = await this.ai.chat.project.getInfo();
390
+ if (projectInfo.config?.customCss) {
391
+ const style = document.createElement('style');
392
+ style.setAttribute('type', 'text/css');
393
+ style.setAttribute('id', 'mujian-custom-css');
394
+ style.textContent = projectInfo.config.customCss;
395
+ document.head.appendChild(style);
396
+ }
381
397
  } catch (error) {
382
398
  Log.e('init error', error);
383
399
  }
package/dist/react.js CHANGED
@@ -728,6 +728,14 @@ class MujianSdk {
728
728
  this.parent = parent;
729
729
  Log.i('mujian sdk client init');
730
730
  await this.call(events_EVENT.MUJIAN_INIT);
731
+ const projectInfo = await this.ai.chat.project.getInfo();
732
+ if (projectInfo.config?.customCss) {
733
+ const style = document.createElement('style');
734
+ style.setAttribute('type', 'text/css');
735
+ style.setAttribute('id', 'mujian-custom-css');
736
+ style.textContent = projectInfo.config.customCss;
737
+ document.head.appendChild(style);
738
+ }
731
739
  } catch (error) {
732
740
  Log.e('init error', error);
733
741
  }
@@ -28,6 +28,7 @@ export type ModelInfo = {
28
28
  };
29
29
  export type ProjectConfig = {
30
30
  qrConfig?: QuickReplyConfig;
31
+ customCss?: string;
31
32
  };
32
33
  export type QuickReply = {
33
34
  id: number;
package/dist/umd/index.js CHANGED
@@ -445,6 +445,14 @@
445
445
  this.parent = parent;
446
446
  Log.i('mujian sdk client init');
447
447
  await this.call(events_EVENT.MUJIAN_INIT);
448
+ const projectInfo = await this.ai.chat.project.getInfo();
449
+ if (projectInfo.config?.customCss) {
450
+ const style = document.createElement('style');
451
+ style.setAttribute('type', 'text/css');
452
+ style.setAttribute('id', 'mujian-custom-css');
453
+ style.textContent = projectInfo.config.customCss;
454
+ document.head.appendChild(style);
455
+ }
448
456
  } catch (error) {
449
457
  Log.e('init error', error);
450
458
  }
@@ -636,6 +644,14 @@
636
644
  this.parent = parent;
637
645
  Log.i('mujian sdk client init');
638
646
  await this.call(events_EVENT.MUJIAN_INIT);
647
+ const projectInfo = await this.ai.chat.project.getInfo();
648
+ if (projectInfo.config?.customCss) {
649
+ const style = document.createElement('style');
650
+ style.setAttribute('type', 'text/css');
651
+ style.setAttribute('id', 'mujian-custom-css');
652
+ style.textContent = projectInfo.config.customCss;
653
+ document.head.appendChild(style);
654
+ }
639
655
  } catch (error) {
640
656
  Log.e('init error', error);
641
657
  }
package/dist/umd/react.js CHANGED
@@ -6564,6 +6564,14 @@ ${content}
6564
6564
  this.parent = parent;
6565
6565
  Log.i('mujian sdk client init');
6566
6566
  await this.call(events_EVENT.MUJIAN_INIT);
6567
+ const projectInfo = await this.ai.chat.project.getInfo();
6568
+ if (projectInfo.config?.customCss) {
6569
+ const style = document.createElement('style');
6570
+ style.setAttribute('type', 'text/css');
6571
+ style.setAttribute('id', 'mujian-custom-css');
6572
+ style.textContent = projectInfo.config.customCss;
6573
+ document.head.appendChild(style);
6574
+ }
6567
6575
  } catch (error) {
6568
6576
  Log.e('init error', error);
6569
6577
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mujian/js-sdk",
3
- "version": "0.0.6-beta.49",
3
+ "version": "0.0.6-beta.49-0.4custom-css",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {