@tempo-kit/plugin-cultural 0.0.0-stage → 1.0.0-rc.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.
- package/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +48 -2
- package/dist/eastern.d.ts +69 -0
- package/dist/eastern.global.min.js +1 -0
- package/dist/eastern.js +211 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.global.min.js +1 -0
- package/dist/index.js +293 -0
- package/dist/install.d.ts +2 -0
- package/dist/install.global.min.js +1 -0
- package/dist/install.js +296 -0
- package/dist/zodiac.d.ts +91 -0
- package/dist/zodiac.global.min.js +1 -0
- package/dist/zodiac.js +96 -0
- package/package.json +75 -4
package/dist/zodiac.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { TermHook, type TermSpan } from 'tempo-kit/plugin/sdk';
|
|
2
|
+
import type { Tempo } from 'tempo-kit';
|
|
3
|
+
export declare const ZODIAC_KEYS: readonly ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"];
|
|
4
|
+
export type WesternZodiacKey = (typeof ZODIAC_KEYS)[number];
|
|
5
|
+
export interface WesternZodiacScope {
|
|
6
|
+
key: WesternZodiacKey;
|
|
7
|
+
symbol: 'Ram' | 'Bull' | 'Twins' | 'Crab' | 'Lion' | 'Virgin' | 'Scales' | 'Scorpion' | 'Archer' | 'Goat' | 'Water Bearer' | 'Fish';
|
|
8
|
+
emoji: string;
|
|
9
|
+
trait: string;
|
|
10
|
+
group: 'western';
|
|
11
|
+
keys: readonly WesternZodiacKey[];
|
|
12
|
+
span: TermSpan;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ## ZodiacTerm
|
|
16
|
+
* Astrological Western Tropical Zodiac signs (`t.term.zdc`, `t.term.zodiac`, `t.term.sunSign`, `t.term.starSign`).
|
|
17
|
+
*/
|
|
18
|
+
export declare const ZodiacTerm: import("tempo-kit/plugin/sdk").TermFactory<{
|
|
19
|
+
[TermHook.ordinal]: (this: any, groups: Record<string, any>, anchor: Tempo) => Tempo | undefined;
|
|
20
|
+
[TermHook.diff]: (this: any, other: Tempo, unit: string, tempo: Tempo) => number | undefined;
|
|
21
|
+
[TermHook.format]: (this: any, token: string, tempo: Tempo) => string | undefined;
|
|
22
|
+
key: string;
|
|
23
|
+
scope: string;
|
|
24
|
+
aliases: string[];
|
|
25
|
+
description: string;
|
|
26
|
+
groups: import("tempo-kit/plugin/sdk").SecureObject<Record<PropertyKey, {
|
|
27
|
+
key: string;
|
|
28
|
+
day: number;
|
|
29
|
+
month: number;
|
|
30
|
+
symbol: string;
|
|
31
|
+
emoji: string;
|
|
32
|
+
trait: string;
|
|
33
|
+
group: string;
|
|
34
|
+
}[]>>;
|
|
35
|
+
keys: readonly ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"];
|
|
36
|
+
resolve(this: Tempo, anchor?: any): import("tempo-kit").Range[];
|
|
37
|
+
/** determine where the current Tempo instance fits within the above range */
|
|
38
|
+
define(this: Tempo, keyOnly?: boolean | number | string, anchor?: any): any;
|
|
39
|
+
}, any>;
|
|
40
|
+
export declare const SunSignTerm: import("tempo-kit/plugin/sdk").TermFactory<{
|
|
41
|
+
[TermHook.ordinal]: (this: any, groups: Record<string, any>, anchor: Tempo) => Tempo | undefined;
|
|
42
|
+
[TermHook.diff]: (this: any, other: Tempo, unit: string, tempo: Tempo) => number | undefined;
|
|
43
|
+
[TermHook.format]: (this: any, token: string, tempo: Tempo) => string | undefined;
|
|
44
|
+
key: string;
|
|
45
|
+
scope: string;
|
|
46
|
+
aliases: string[];
|
|
47
|
+
description: string;
|
|
48
|
+
groups: import("tempo-kit/plugin/sdk").SecureObject<Record<PropertyKey, {
|
|
49
|
+
key: string;
|
|
50
|
+
day: number;
|
|
51
|
+
month: number;
|
|
52
|
+
symbol: string;
|
|
53
|
+
emoji: string;
|
|
54
|
+
trait: string;
|
|
55
|
+
group: string;
|
|
56
|
+
}[]>>;
|
|
57
|
+
keys: readonly ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"];
|
|
58
|
+
resolve(this: Tempo, anchor?: any): import("tempo-kit").Range[];
|
|
59
|
+
/** determine where the current Tempo instance fits within the above range */
|
|
60
|
+
define(this: Tempo, keyOnly?: boolean | number | string, anchor?: any): any;
|
|
61
|
+
}, any>;
|
|
62
|
+
export declare const StarSignTerm: import("tempo-kit/plugin/sdk").TermFactory<{
|
|
63
|
+
[TermHook.ordinal]: (this: any, groups: Record<string, any>, anchor: Tempo) => Tempo | undefined;
|
|
64
|
+
[TermHook.diff]: (this: any, other: Tempo, unit: string, tempo: Tempo) => number | undefined;
|
|
65
|
+
[TermHook.format]: (this: any, token: string, tempo: Tempo) => string | undefined;
|
|
66
|
+
key: string;
|
|
67
|
+
scope: string;
|
|
68
|
+
aliases: string[];
|
|
69
|
+
description: string;
|
|
70
|
+
groups: import("tempo-kit/plugin/sdk").SecureObject<Record<PropertyKey, {
|
|
71
|
+
key: string;
|
|
72
|
+
day: number;
|
|
73
|
+
month: number;
|
|
74
|
+
symbol: string;
|
|
75
|
+
emoji: string;
|
|
76
|
+
trait: string;
|
|
77
|
+
group: string;
|
|
78
|
+
}[]>>;
|
|
79
|
+
keys: readonly ["Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces"];
|
|
80
|
+
resolve(this: Tempo, anchor?: any): import("tempo-kit").Range[];
|
|
81
|
+
/** determine where the current Tempo instance fits within the above range */
|
|
82
|
+
define(this: Tempo, keyOnly?: boolean | number | string, anchor?: any): any;
|
|
83
|
+
}, any>;
|
|
84
|
+
declare module 'tempo-kit' {
|
|
85
|
+
interface TempoTermRegistry {
|
|
86
|
+
zdc: WesternZodiacKey;
|
|
87
|
+
sunSign: WesternZodiacKey;
|
|
88
|
+
starSign: WesternZodiacKey;
|
|
89
|
+
zodiac: WesternZodiacScope;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var Magma;((Magma||={}).plugins||={}).cultural=(()=>{var T=Object.create;var s=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var j=(e,r)=>()=>{try{return r||e((r={exports:{}}).exports,r),r.exports}catch(o){throw r=0,o}},u=(e,r)=>{for(var o in r)s(e,o,{get:r[o],enumerable:!0})},a=(e,r,o,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of k(r))!v.call(e,t)&&t!==o&&s(e,t,{get:()=>r[t],enumerable:!(l=S(r,t))||l.enumerable});return e},n=(e,r,o)=>(a(e,r,"default"),o&&a(o,r,"default")),g=(e,r,o)=>(o=e!=null?T(w(e)):{},a(r||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e)),W=e=>a(s({},"__esModule",{value:!0}),e);var p=j((K,h)=>{"use strict";h.exports=window.Magma.pluginSdk});var C={};u(C,{StarSignTerm:()=>A,SunSignTerm:()=>x,ZODIAC_KEYS:()=>c,ZodiacTerm:()=>d});var i={};u(i,{definePlugin:()=>Z,defineTerm:()=>y});n(i,g(p()));var m=g(p()),Z=e=>(0,m.definePlugin)({...e,version:"1.0.0-rc.0"}),y=e=>(0,m.defineTerm)({...e,version:"1.0.0-rc.0"});var f=(0,i.defineRange)([{key:"Aries",day:21,month:3,symbol:"Ram",emoji:"\u2648",trait:"Daring and energetic, a natural leader",group:"western"},{key:"Taurus",day:20,month:4,symbol:"Bull",emoji:"\u2649",trait:"Reliable and patient, enjoys luxury",group:"western"},{key:"Gemini",day:21,month:5,symbol:"Twins",emoji:"\u264A",trait:"Adaptable and intellectual, great communicator",group:"western"},{key:"Cancer",day:21,month:6,symbol:"Crab",emoji:"\u264B",trait:"Protective and intuitive, deeply emotional",group:"western"},{key:"Leo",day:23,month:7,symbol:"Lion",emoji:"\u264C",trait:"Confident and ambitious, loves being center stage",group:"western"},{key:"Virgo",day:23,month:8,symbol:"Virgin",emoji:"\u264D",trait:"Analytical and practical, meticulous and kind",group:"western"},{key:"Libra",day:23,month:9,symbol:"Scales",emoji:"\u264E",trait:"Diplomatic and fair, values harmony",group:"western"},{key:"Scorpio",day:23,month:10,symbol:"Scorpion",emoji:"\u264F",trait:"Passionate and resourceful, dynamic and brave",group:"western"},{key:"Sagittarius",day:22,month:11,symbol:"Archer",emoji:"\u2650",trait:"Optimistic and free-spirited, loves travel",group:"western"},{key:"Capricorn",day:22,month:12,symbol:"Goat",emoji:"\u2651",trait:"Disciplined and persistent, highly practical",group:"western"},{key:"Aquarius",day:20,month:1,symbol:"Water Bearer",emoji:"\u2652",trait:"Original and humanitarian, values independence",group:"western"},{key:"Pisces",day:19,month:2,symbol:"Fish",emoji:"\u2653",trait:"Compassionate and artistic, deeply intuitive",group:"western"}],"group");function b(e,r){return(0,i.resolveCycleWindow)(e,f,{anchor:r,groupBy:["group"],group:"western"})}var c=Object.freeze(["Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn","Aquarius","Pisces"]),d=y({key:"zdc",scope:"zodiac",aliases:["sunSign","starSign"],description:"Astrological Western Tropical Zodiac sign",groups:f,keys:c,resolve(e){return b(this,e)},define(e,r){let o=(0,i.getTermRange)(this,b(this,r),e,r);return o&&typeof o=="object"?{...o,keys:c}:o},[i.TermHook.ordinal](e,r){return(0,i.resolveRangeOrdinal)(this,e,r)},[i.TermHook.diff](e,r,o){return(0,i.resolveRangeDiff)(this,e,r,o)},[i.TermHook.format](e,r){return(0,i.resolveRangeFormat)(this,e,r)}}),x=d,A=d;return W(C);})();
|
package/dist/zodiac.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
|
|
19
|
+
// auto-inject-version:tempo-kit/plugin/sdk
|
|
20
|
+
var sdk_exports = {};
|
|
21
|
+
__export(sdk_exports, {
|
|
22
|
+
definePlugin: () => definePlugin,
|
|
23
|
+
defineTerm: () => defineTerm
|
|
24
|
+
});
|
|
25
|
+
__reExport(sdk_exports, sdk_star);
|
|
26
|
+
import * as sdk_star from "tempo-kit/plugin/sdk";
|
|
27
|
+
import { definePlugin as originalPlugin, defineTerm as originalTerm } from "tempo-kit/plugin/sdk";
|
|
28
|
+
var definePlugin = (config) => originalPlugin({ ...config, version: "1.0.0-rc.0" });
|
|
29
|
+
var defineTerm = (config) => originalTerm({ ...config, version: "1.0.0-rc.0" });
|
|
30
|
+
|
|
31
|
+
// src/zodiac.ts
|
|
32
|
+
var groups = /* @__PURE__ */ (0, sdk_exports.defineRange)([
|
|
33
|
+
// Western (Tropical) - @link https://en.wikipedia.org/wiki/Astrological_sign
|
|
34
|
+
{ key: "Aries", day: 21, month: 3, symbol: "Ram", emoji: "\u2648", trait: "Daring and energetic, a natural leader", group: "western" },
|
|
35
|
+
{ key: "Taurus", day: 20, month: 4, symbol: "Bull", emoji: "\u2649", trait: "Reliable and patient, enjoys luxury", group: "western" },
|
|
36
|
+
{ key: "Gemini", day: 21, month: 5, symbol: "Twins", emoji: "\u264A", trait: "Adaptable and intellectual, great communicator", group: "western" },
|
|
37
|
+
{ key: "Cancer", day: 21, month: 6, symbol: "Crab", emoji: "\u264B", trait: "Protective and intuitive, deeply emotional", group: "western" },
|
|
38
|
+
{ key: "Leo", day: 23, month: 7, symbol: "Lion", emoji: "\u264C", trait: "Confident and ambitious, loves being center stage", group: "western" },
|
|
39
|
+
{ key: "Virgo", day: 23, month: 8, symbol: "Virgin", emoji: "\u264D", trait: "Analytical and practical, meticulous and kind", group: "western" },
|
|
40
|
+
{ key: "Libra", day: 23, month: 9, symbol: "Scales", emoji: "\u264E", trait: "Diplomatic and fair, values harmony", group: "western" },
|
|
41
|
+
{ key: "Scorpio", day: 23, month: 10, symbol: "Scorpion", emoji: "\u264F", trait: "Passionate and resourceful, dynamic and brave", group: "western" },
|
|
42
|
+
{ key: "Sagittarius", day: 22, month: 11, symbol: "Archer", emoji: "\u2650", trait: "Optimistic and free-spirited, loves travel", group: "western" },
|
|
43
|
+
{ key: "Capricorn", day: 22, month: 12, symbol: "Goat", emoji: "\u2651", trait: "Disciplined and persistent, highly practical", group: "western" },
|
|
44
|
+
{ key: "Aquarius", day: 20, month: 1, symbol: "Water Bearer", emoji: "\u2652", trait: "Original and humanitarian, values independence", group: "western" },
|
|
45
|
+
{ key: "Pisces", day: 19, month: 2, symbol: "Fish", emoji: "\u2653", trait: "Compassionate and artistic, deeply intuitive", group: "western" }
|
|
46
|
+
], "group");
|
|
47
|
+
function resolve(t, anchor) {
|
|
48
|
+
return (0, sdk_exports.resolveCycleWindow)(t, groups, { anchor, groupBy: ["group"], group: "western" });
|
|
49
|
+
}
|
|
50
|
+
var ZODIAC_KEYS = Object.freeze([
|
|
51
|
+
"Aries",
|
|
52
|
+
"Taurus",
|
|
53
|
+
"Gemini",
|
|
54
|
+
"Cancer",
|
|
55
|
+
"Leo",
|
|
56
|
+
"Virgo",
|
|
57
|
+
"Libra",
|
|
58
|
+
"Scorpio",
|
|
59
|
+
"Sagittarius",
|
|
60
|
+
"Capricorn",
|
|
61
|
+
"Aquarius",
|
|
62
|
+
"Pisces"
|
|
63
|
+
]);
|
|
64
|
+
var ZodiacTerm = /* @__PURE__ */ defineTerm({
|
|
65
|
+
key: "zdc",
|
|
66
|
+
scope: "zodiac",
|
|
67
|
+
aliases: ["sunSign", "starSign"],
|
|
68
|
+
description: "Astrological Western Tropical Zodiac sign",
|
|
69
|
+
groups,
|
|
70
|
+
keys: ZODIAC_KEYS,
|
|
71
|
+
resolve(anchor) {
|
|
72
|
+
return resolve(this, anchor);
|
|
73
|
+
},
|
|
74
|
+
/** determine where the current Tempo instance fits within the above range */
|
|
75
|
+
define(keyOnly, anchor) {
|
|
76
|
+
const scope = (0, sdk_exports.getTermRange)(this, resolve(this, anchor), keyOnly, anchor);
|
|
77
|
+
return scope && typeof scope === "object" ? { ...scope, keys: ZODIAC_KEYS } : scope;
|
|
78
|
+
},
|
|
79
|
+
[sdk_exports.TermHook.ordinal](groups2, anchor) {
|
|
80
|
+
return (0, sdk_exports.resolveRangeOrdinal)(this, groups2, anchor);
|
|
81
|
+
},
|
|
82
|
+
[sdk_exports.TermHook.diff](other, unit, tempo) {
|
|
83
|
+
return (0, sdk_exports.resolveRangeDiff)(this, other, unit, tempo);
|
|
84
|
+
},
|
|
85
|
+
[sdk_exports.TermHook.format](token, tempo) {
|
|
86
|
+
return (0, sdk_exports.resolveRangeFormat)(this, token, tempo);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
var SunSignTerm = ZodiacTerm;
|
|
90
|
+
var StarSignTerm = ZodiacTerm;
|
|
91
|
+
export {
|
|
92
|
+
StarSignTerm,
|
|
93
|
+
SunSignTerm,
|
|
94
|
+
ZODIAC_KEYS,
|
|
95
|
+
ZodiacTerm
|
|
96
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tempo-kit/plugin-cultural",
|
|
3
|
-
"version": "0.0.0
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-rc.0",
|
|
4
|
+
"description": "Tempo community plugin for traditional and cultural calendar terms — Western Tropical Zodiac (ZodiacTerm) and East Asian Sexagenary Lunar Zodiac (EasternTerm) with regional variants.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"./dist/install.js"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/magmacomputing/magma.git",
|
|
14
|
+
"directory": "packages/plugins/cultural"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md",
|
|
19
|
+
"CHANGELOG.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"registry": "https://registry.npmjs.org/",
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsup && tsc",
|
|
28
|
+
"test": "vitest run -c ../vitest.shared.ts",
|
|
29
|
+
"prepublishOnly": "tempo-cli prepublish"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"tempo-fns": "^1.2.0"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"tempo-kit": "^5.0.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"tempo-kit": "^5.0.0"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"tempo-kit",
|
|
42
|
+
"tempo-kit-plugin",
|
|
43
|
+
"tempo",
|
|
44
|
+
"temporal",
|
|
45
|
+
"tempo-plugin",
|
|
46
|
+
"cultural",
|
|
47
|
+
"zodiac",
|
|
48
|
+
"eastern-zodiac",
|
|
49
|
+
"shengxiao",
|
|
50
|
+
"astrology",
|
|
51
|
+
"calendar",
|
|
52
|
+
"typescript"
|
|
53
|
+
],
|
|
54
|
+
"type": "module",
|
|
55
|
+
"exports": {
|
|
56
|
+
".": {
|
|
57
|
+
"types": "./dist/index.d.ts",
|
|
58
|
+
"import": "./dist/index.js",
|
|
59
|
+
"default": "./dist/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./zodiac": {
|
|
62
|
+
"types": "./dist/zodiac.d.ts",
|
|
63
|
+
"import": "./dist/zodiac.js",
|
|
64
|
+
"default": "./dist/zodiac.js"
|
|
65
|
+
},
|
|
66
|
+
"./eastern": {
|
|
67
|
+
"types": "./dist/eastern.d.ts",
|
|
68
|
+
"import": "./dist/eastern.js",
|
|
69
|
+
"default": "./dist/eastern.js"
|
|
70
|
+
},
|
|
71
|
+
"./install": {
|
|
72
|
+
"types": "./dist/install.d.ts",
|
|
73
|
+
"import": "./dist/install.js",
|
|
74
|
+
"default": "./dist/install.js"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|