@fayz-ai/plugin-marketing 0.1.2 → 0.1.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Faya Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  var React4 = require('react');
4
4
  var core = require('@fayz-ai/core');
5
- var ui = require('@fayz-ai/ui');
6
5
  var saas = require('@fayz-ai/saas');
6
+ var ui = require('@fayz-ai/ui');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var lucideReact = require('lucide-react');
9
9
  var vanilla = require('zustand/vanilla');
@@ -583,6 +583,42 @@ function SettingsView() {
583
583
  ] })
584
584
  ] });
585
585
  }
586
+
587
+ // src/registries.ts
588
+ var KIND_OPTIONS = [
589
+ { value: "paid", label: "Paid" },
590
+ { value: "organic", label: "Organic" },
591
+ { value: "social", label: "Social" },
592
+ { value: "referral", label: "Referral" },
593
+ { value: "direct", label: "Direct" },
594
+ { value: "outbound", label: "Outbound" }
595
+ ];
596
+ var channelEntity = {
597
+ name: "Channel",
598
+ namePlural: "Channels",
599
+ icon: "Radio",
600
+ displayField: "label",
601
+ defaultSort: "label",
602
+ fields: [
603
+ { key: "label", label: "Channel", type: "text", required: true, showInTable: true, searchable: true },
604
+ { key: "kind", label: "Type", type: "select", options: KIND_OPTIONS, showInTable: true },
605
+ { key: "icon", label: "Icon", type: "text", showInTable: true }
606
+ ],
607
+ facets: [{ field: "kind" }]
608
+ };
609
+ function buildMarketingRegistries(channels) {
610
+ return [
611
+ {
612
+ id: "channels",
613
+ entity: channelEntity,
614
+ icon: "Radio",
615
+ description: "Acquisition channels tracked for this workspace",
616
+ display: "table",
617
+ readOnly: true,
618
+ seedData: channels.map((c) => ({ id: c.id, label: c.label, kind: c.kind, icon: c.icon }))
619
+ }
620
+ ];
621
+ }
586
622
  function useEnsureMarketingData() {
587
623
  const overview = useMarketingStore((s) => s.overview);
588
624
  const loading = useMarketingStore((s) => s.loading);
@@ -1234,10 +1270,17 @@ function createMarketingPlugin(options) {
1234
1270
  React4__default.default.createElement(MarketingPage, { config, provider, store })
1235
1271
  );
1236
1272
  PageComponent.displayName = "MarketingPage";
1273
+ const marketingRegistries = buildMarketingRegistries(config.channels);
1237
1274
  const SettingsComponent = () => React4__default.default.createElement(
1238
1275
  MarketingContextProvider,
1239
1276
  { config, provider, store },
1240
- React4__default.default.createElement(SettingsView)
1277
+ React4__default.default.createElement(saas.PluginSettingsPanel, {
1278
+ title: config.labels.settings ?? config.labels.pageTitle,
1279
+ subtitle: config.labels.pageSubtitle,
1280
+ generalSettings: React4__default.default.createElement(SettingsView),
1281
+ registries: marketingRegistries,
1282
+ routeBase: "/settings/marketing"
1283
+ })
1241
1284
  );
1242
1285
  SettingsComponent.displayName = "MarketingSettings";
1243
1286
  return {
@@ -1333,6 +1376,7 @@ function createMarketingPlugin(options) {
1333
1376
  permission: { feature: "marketing", action: "create" }
1334
1377
  }
1335
1378
  ],
1379
+ registries: marketingRegistries,
1336
1380
  settings: [
1337
1381
  {
1338
1382
  id: "marketing",