@maxblom/headlessmax-appshell 0.1.0

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.
@@ -0,0 +1,57 @@
1
+ import { defineComponent, openBlock, createElementBlock, renderSlot, createElementVNode, toDisplayString, unref, Ref } from 'vue';
2
+
3
+ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
4
+ __name: "AppHeader",
5
+ props: {
6
+ title: { type: String, required: false }
7
+ },
8
+ setup(__props) {
9
+ return (_ctx, _cache) => {
10
+ return openBlock(), createElementBlock("header", null, [
11
+ renderSlot(_ctx.$slots, "logo", {}, () => [
12
+ createElementVNode(
13
+ "strong",
14
+ null,
15
+ toDisplayString(__props.title ?? "HeadlessMax"),
16
+ 1
17
+ /* TEXT */
18
+ )
19
+ ]),
20
+ createElementVNode("nav", null, [
21
+ renderSlot(_ctx.$slots, "nav")
22
+ ])
23
+ ]);
24
+ };
25
+ }
26
+ });
27
+
28
+ var _sfc_main = /* @__PURE__ */ defineComponent({
29
+ __name: "AppFooter",
30
+ setup(__props) {
31
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
32
+ return (_ctx, _cache) => {
33
+ return openBlock(), createElementBlock("footer", null, [
34
+ renderSlot(_ctx.$slots, "default", {}, () => [
35
+ createElementVNode(
36
+ "p",
37
+ null,
38
+ "\xA9 " + toDisplayString(unref(year)) + " HeadlessMax",
39
+ 1
40
+ /* TEXT */
41
+ )
42
+ ])
43
+ ]);
44
+ };
45
+ }
46
+ });
47
+
48
+ interface FeatureFlags {
49
+ [key: string]: boolean;
50
+ }
51
+ declare function provideFeatureFlags(flags: FeatureFlags): void;
52
+ declare function useFeatureFlag(key: string, options?: {
53
+ fallback?: boolean;
54
+ }): Ref<boolean>;
55
+
56
+ export { _sfc_main as AppFooter, _sfc_main$1 as AppHeader, provideFeatureFlags, useFeatureFlag };
57
+ export type { FeatureFlags };
@@ -0,0 +1,57 @@
1
+ import { defineComponent, openBlock, createElementBlock, renderSlot, createElementVNode, toDisplayString, unref, Ref } from 'vue';
2
+
3
+ var _sfc_main$1 = /* @__PURE__ */ defineComponent({
4
+ __name: "AppHeader",
5
+ props: {
6
+ title: { type: String, required: false }
7
+ },
8
+ setup(__props) {
9
+ return (_ctx, _cache) => {
10
+ return openBlock(), createElementBlock("header", null, [
11
+ renderSlot(_ctx.$slots, "logo", {}, () => [
12
+ createElementVNode(
13
+ "strong",
14
+ null,
15
+ toDisplayString(__props.title ?? "HeadlessMax"),
16
+ 1
17
+ /* TEXT */
18
+ )
19
+ ]),
20
+ createElementVNode("nav", null, [
21
+ renderSlot(_ctx.$slots, "nav")
22
+ ])
23
+ ]);
24
+ };
25
+ }
26
+ });
27
+
28
+ var _sfc_main = /* @__PURE__ */ defineComponent({
29
+ __name: "AppFooter",
30
+ setup(__props) {
31
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
32
+ return (_ctx, _cache) => {
33
+ return openBlock(), createElementBlock("footer", null, [
34
+ renderSlot(_ctx.$slots, "default", {}, () => [
35
+ createElementVNode(
36
+ "p",
37
+ null,
38
+ "\xA9 " + toDisplayString(unref(year)) + " HeadlessMax",
39
+ 1
40
+ /* TEXT */
41
+ )
42
+ ])
43
+ ]);
44
+ };
45
+ }
46
+ });
47
+
48
+ interface FeatureFlags {
49
+ [key: string]: boolean;
50
+ }
51
+ declare function provideFeatureFlags(flags: FeatureFlags): void;
52
+ declare function useFeatureFlag(key: string, options?: {
53
+ fallback?: boolean;
54
+ }): Ref<boolean>;
55
+
56
+ export { _sfc_main as AppFooter, _sfc_main$1 as AppHeader, provideFeatureFlags, useFeatureFlag };
57
+ export type { FeatureFlags };
package/dist/index.mjs ADDED
@@ -0,0 +1,58 @@
1
+ import { defineComponent, openBlock, createElementBlock, renderSlot, createElementVNode, toDisplayString, unref, provide, inject, ref } from 'vue';
2
+
3
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4
+ __name: "AppHeader",
5
+ props: {
6
+ title: { type: String, required: false }
7
+ },
8
+ setup(__props) {
9
+ return (_ctx, _cache) => {
10
+ return openBlock(), createElementBlock("header", null, [
11
+ renderSlot(_ctx.$slots, "logo", {}, () => [
12
+ createElementVNode(
13
+ "strong",
14
+ null,
15
+ toDisplayString(__props.title ?? "HeadlessMax"),
16
+ 1
17
+ /* TEXT */
18
+ )
19
+ ]),
20
+ createElementVNode("nav", null, [
21
+ renderSlot(_ctx.$slots, "nav")
22
+ ])
23
+ ]);
24
+ };
25
+ }
26
+ });
27
+
28
+ const _sfc_main = /* @__PURE__ */ defineComponent({
29
+ __name: "AppFooter",
30
+ setup(__props) {
31
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
32
+ return (_ctx, _cache) => {
33
+ return openBlock(), createElementBlock("footer", null, [
34
+ renderSlot(_ctx.$slots, "default", {}, () => [
35
+ createElementVNode(
36
+ "p",
37
+ null,
38
+ "\xA9 " + toDisplayString(unref(year)) + " HeadlessMax",
39
+ 1
40
+ /* TEXT */
41
+ )
42
+ ])
43
+ ]);
44
+ };
45
+ }
46
+ });
47
+
48
+ const FLAGS_KEY = Symbol("headlessmax-feature-flags");
49
+ function provideFeatureFlags(flags) {
50
+ provide(FLAGS_KEY, flags);
51
+ }
52
+ function useFeatureFlag(key, options) {
53
+ const flags = inject(FLAGS_KEY, {});
54
+ const fallback = options?.fallback ?? false;
55
+ return ref(flags[key] ?? fallback);
56
+ }
57
+
58
+ export { _sfc_main as AppFooter, _sfc_main$1 as AppHeader, provideFeatureFlags, useFeatureFlag };
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@maxblom/headlessmax-appshell",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "./dist/index.mjs",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.mjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "license": "MIT",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/maxblom123/HeadlessMax.git"
22
+ },
23
+ "keywords": [
24
+ "vue",
25
+ "nuxt",
26
+ "appshell",
27
+ "feature-flags"
28
+ ],
29
+ "scripts": {
30
+ "test": "vitest run",
31
+ "build": "unbuild"
32
+ },
33
+ "peerDependencies": {
34
+ "vue": "^3.5.40"
35
+ },
36
+ "devDependencies": {
37
+ "@vitejs/plugin-vue": "^6.0.8",
38
+ "@vue/test-utils": "^2.4.11",
39
+ "happy-dom": "^20.11.1",
40
+ "unbuild": "^3.0.0",
41
+ "vitest": "^4.1.10"
42
+ }
43
+ }