notations 0.0.48 → 0.0.49
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/lib/cjs/beats.d.ts +34 -69
- package/lib/cjs/beats.js +178 -439
- package/lib/cjs/beats.js.map +1 -1
- package/lib/cjs/beatutils.d.ts +3 -0
- package/lib/cjs/beatutils.js +64 -0
- package/lib/cjs/beatutils.js.map +1 -0
- package/lib/cjs/beatview.d.ts +18 -0
- package/lib/cjs/beatview.js +62 -0
- package/lib/cjs/beatview.js.map +1 -0
- package/lib/cjs/carnatic/LineView.d.ts +2 -7
- package/lib/cjs/carnatic/LineView.js +13 -31
- package/lib/cjs/carnatic/LineView.js.map +1 -1
- package/lib/cjs/carnatic/NotationView.d.ts +8 -7
- package/lib/cjs/carnatic/NotationView.js +73 -153
- package/lib/cjs/carnatic/NotationView.js.map +1 -1
- package/lib/cjs/carnatic/atomviews.js +149 -287
- package/lib/cjs/carnatic/atomviews.js.map +1 -1
- package/lib/cjs/carnatic/beatviews.d.ts +4 -13
- package/lib/cjs/carnatic/beatviews.js +23 -118
- package/lib/cjs/carnatic/beatviews.js.map +1 -1
- package/lib/cjs/carnatic/embelishments.d.ts +1 -1
- package/lib/cjs/carnatic/embelishments.js +189 -283
- package/lib/cjs/carnatic/embelishments.js.map +1 -1
- package/lib/cjs/carnatic/gamakas.js +15 -47
- package/lib/cjs/carnatic/gamakas.js.map +1 -1
- package/lib/cjs/commands.js +111 -271
- package/lib/cjs/commands.js.map +1 -1
- package/lib/cjs/core.d.ts +6 -1
- package/lib/cjs/core.js +288 -493
- package/lib/cjs/core.js.map +1 -1
- package/lib/cjs/cycle.js +175 -367
- package/lib/cjs/cycle.js.map +1 -1
- package/lib/cjs/entity.js +48 -102
- package/lib/cjs/entity.js.map +1 -1
- package/lib/cjs/grids.d.ts +124 -1
- package/lib/cjs/grids.js +546 -6
- package/lib/cjs/grids.js.map +1 -1
- package/lib/cjs/iterators.js +96 -234
- package/lib/cjs/iterators.js.map +1 -1
- package/lib/cjs/layouts.d.ts +1 -1
- package/lib/cjs/layouts.js +62 -98
- package/lib/cjs/layouts.js.map +1 -1
- package/lib/cjs/loader.d.ts +2 -2
- package/lib/cjs/loader.js +23 -123
- package/lib/cjs/loader.js.map +1 -1
- package/lib/cjs/notation.d.ts +0 -3
- package/lib/cjs/notation.js +139 -241
- package/lib/cjs/notation.js.map +1 -1
- package/lib/cjs/parser.d.ts +2 -0
- package/lib/cjs/parser.js +217 -219
- package/lib/cjs/parser.js.map +1 -1
- package/lib/cjs/shapes.js +149 -283
- package/lib/cjs/shapes.js.map +1 -1
- package/lib/cjs/utils.d.ts +8 -0
- package/lib/cjs/utils.js +60 -55
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/beats.d.ts +34 -69
- package/lib/esm/beats.js +172 -438
- package/lib/esm/beats.js.map +1 -1
- package/lib/esm/beatutils.d.ts +3 -0
- package/lib/esm/beatutils.js +37 -0
- package/lib/esm/beatutils.js.map +1 -0
- package/lib/esm/beatview.d.ts +18 -0
- package/lib/esm/beatview.js +35 -0
- package/lib/esm/beatview.js.map +1 -0
- package/lib/esm/carnatic/LineView.d.ts +2 -7
- package/lib/esm/carnatic/LineView.js +12 -31
- package/lib/esm/carnatic/LineView.js.map +1 -1
- package/lib/esm/carnatic/NotationView.d.ts +8 -7
- package/lib/esm/carnatic/NotationView.js +71 -152
- package/lib/esm/carnatic/NotationView.js.map +1 -1
- package/lib/esm/carnatic/atomviews.js +144 -284
- package/lib/esm/carnatic/atomviews.js.map +1 -1
- package/lib/esm/carnatic/beatviews.d.ts +4 -13
- package/lib/esm/carnatic/beatviews.js +21 -94
- package/lib/esm/carnatic/beatviews.js.map +1 -1
- package/lib/esm/carnatic/embelishments.d.ts +1 -1
- package/lib/esm/carnatic/embelishments.js +187 -296
- package/lib/esm/carnatic/embelishments.js.map +1 -1
- package/lib/esm/carnatic/gamakas.js +14 -48
- package/lib/esm/carnatic/gamakas.js.map +1 -1
- package/lib/esm/commands.js +100 -271
- package/lib/esm/commands.js.map +1 -1
- package/lib/esm/core.d.ts +6 -1
- package/lib/esm/core.js +286 -502
- package/lib/esm/core.js.map +1 -1
- package/lib/esm/cycle.js +172 -367
- package/lib/esm/cycle.js.map +1 -1
- package/lib/esm/entity.js +48 -104
- package/lib/esm/entity.js.map +1 -1
- package/lib/esm/grids.d.ts +124 -1
- package/lib/esm/grids.js +515 -5
- package/lib/esm/grids.js.map +1 -1
- package/lib/esm/iterators.js +93 -235
- package/lib/esm/iterators.js.map +1 -1
- package/lib/esm/layouts.d.ts +1 -1
- package/lib/esm/layouts.js +60 -97
- package/lib/esm/layouts.js.map +1 -1
- package/lib/esm/loader.d.ts +2 -2
- package/lib/esm/loader.js +20 -120
- package/lib/esm/loader.js.map +1 -1
- package/lib/esm/notation.d.ts +0 -3
- package/lib/esm/notation.js +135 -242
- package/lib/esm/notation.js.map +1 -1
- package/lib/esm/parser.d.ts +2 -0
- package/lib/esm/parser.js +211 -214
- package/lib/esm/parser.js.map +1 -1
- package/lib/esm/shapes.js +148 -288
- package/lib/esm/shapes.js.map +1 -1
- package/lib/esm/utils.d.ts +8 -0
- package/lib/esm/utils.js +55 -51
- package/lib/esm/utils.js.map +1 -1
- package/package.json +2 -1
package/lib/cjs/parser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAuC;AACvC,wCAA4B;AAC5B,yCAA6B;AAC7B,+BAA6F;AAE7F,uCAWoB;AAGpB,mDAAuC;AAEvC,IAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;AACjC,IAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAWtB,IAAA,KAAA,OAAsB,CAAC,C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E;YAC5B,OAAO,IAAI,oBAAS,CAAC,MAAM,CAAC,CAAC;SAC9B;aAAM,IAAI,KAAK,IAAI,OAAO,EAAE;YAC3B,OAAO,IAAI,mBAAQ,CAAC,MAAM,CAAC,CAAC;SAC7B;aAAM;YAEL,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;SAC9C;IACH,CAAC;IAED,2BAAU,GAAV,UAAW,GAAY;QACrB,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED,sBAAK,GAAL,UAAM,KAAa;QAAnB,iBAWC;QAVC,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE;YAChC,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,YAAY,EAAE,UAAC,GAAwB;gBACrC,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;QACH,OAAO,KAAK,CAAC;IACf,CAAC;IAED,kCAAiB,GAAjB,UAAkB,KAAa;QAC7B,OAAO,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACH,aAAC;AAAD,CAAC,AArMD,IAqMC;AArMY,wBAAM","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport * as G from \"galore\";\nimport * as TLEX from \"tlex\";\nimport { Literal, AtomType, Note, Atom, Rest, Space, Syllable, Group, Marker } from \"./core\";\nimport { Command, CmdParam } from \"./notation\";\nimport {\n RawEmbedding,\n ApplyLayout,\n AddAtoms,\n SetCycle,\n SetBeatDuration,\n SetBreaks,\n ActivateRole,\n CreateRole,\n CreateLine,\n MetaData,\n} from \"./commands\";\n\n// TODO - Make this plugable from the client instead of hard coded\nimport * as carnatic from \"./carnatic\";\n\nconst ONE = TSU.Num.Fraction.ONE;\nconst TWO = ONE.timesNum(2);\n\n/**\n * V4 of our parser builds on V3 and has the following improvements:\n *\n * 1. Embedding Headings to demarcate sections so users dont have to use\n * explicit MD for headings.\n * 2. Unlike V3 here users break out *of* song instead instead break out \"into\"\n * song. So users spend more time writing notation and less worrying about\n * other things like headings etc.\n */\nconst [parser, itemGraph] = G.newParser(\n String.raw`\n %define IdentChar /[^%!@&\\^|\\[\\]={}()+\\-,;~: \\t\\f\\r\\n\\v\\\\\\.]/\n\n %token BSLASH \"\\\\\"\n %token OPEN_SQ \"[\"\n %token CLOSE_SQ \"]\"\n %token EQUALS \"=\"\n %token OPEN_PAREN \"(\"\n %token CLOSE_PAREN \")\"\n %token OPEN_BRACE \"{\"\n %token CLOSE_BRACE \"}\"\n %token SLASH \"/\"\n %token STAR \"*\"\n %token CARET \"^\"\n // %skip \"-\"\n %token COMMA \",\"\n %token SEMI_COLON \";\"\n %token COLON \":\"\n\n %token SINGLE_LINE_RAW_STRING />(.*)$/m { toSingleLineRawString }\n %token MULTI_LINE_RAW_STRING /r(#{0,})\"/ { toMultiLineRawString }\n\n %token EMBELISHMENT /~[^\\s]*/ { toEmbelishment }\n %token NUMBER /-?\\d+/ { toNumber }\n %token BOOLEAN /true|false/ { toBoolean }\n %token POST_MARKER /<<\"(([^\"\\\\\\n]|\\\\.|\\\\\\n)*)\"/ { toMarker }\n %token POST_MARKER /<<'(([^'\\\\\\n]|\\\\.|\\\\\\n)*)'/ { toMarker }\n %token PRE_MARKER /\"(([^\"\\\\\\n]|\\\\.|\\\\\\n)*)\">>/ { toMarker }\n %token PRE_MARKER /'(([^'\\\\\\n]|\\\\.|\\\\\\n)*)'>>/ { toMarker }\n %token STRING /\"([^\"\\\\\\n]|\\\\.|\\\\\\n)*\"/ { toString }\n %token STRING /'([^'\\\\\\n]|\\\\.|\\\\\\n)*'/ { toString }\n %token DOTS_IDENT /(\\.+)({IdentChar}+)/ { toOctavedNote }\n %token IDENT_DOTS /({IdentChar}+)(\\.+)/ { toOctavedNote }\n %token IDENT_COLON /{IdentChar}+:/ { toRoleSelector }\n %token IDENT /{IdentChar}+/\n %token BSLASH_IDENT /\\\\{IDENT}/ { toCommandName }\n %token BSLASH_NUMBER /\\\\{NUMBER}/\n %token HYPHEN /-/\n %skip /[ \\t\\n\\f\\r]+/\n %skip_flex \"//.*$\"\n %skip /\\/\\*.*?\\*\\//\n\n Elements -> Elements Command Atoms { appendCommand } \n | Elements RoleSelector Atoms { appendRoleSelector } \n | Elements Embedding Atoms { insertEmbedding }\n | Atoms { appendAtoms }\n ;\n\n Embedding -> SINGLE_LINE_RAW_STRING | MULTI_LINE_RAW_STRING ;\n\n Command -> BSLASH_IDENT CommandParams ? { newCommand } ;\n CommandParams -> OPEN_PAREN ParamList ? CLOSE_PAREN { $2 } ;\n\n ParamList -> ParamList COMMA Param { concatParamList } ;\n ParamList -> Param { newParamList };\n Param -> ParamValue { newParam } ;\n Param -> ParamKey EQUALS ParamValue { newParam } ;\n ParamKey -> IDENT ;\n ParamValue -> ( STRING | Fraction | NUMBER | BOOLEAN ) ;\n\n RoleSelector -> IDENT_COLON ;\n\n Atoms -> Atoms Atom { concatAtoms } ;\n Atoms -> { newArray } ;\n\n Atom -> Leaf ;\n Atom -> Duration Leaf { applyDuration } ;\n Leaf -> Space | Lit | Group | Rest | Marker ;\n Rest -> HYPHEN { newRest };\n Marker -> PRE_MARKER\n | POST_MARKER\n ;\n\n Space -> COMMA { newSpace } \n | SEMI_COLON { newDoubleSpace } \n | UNDER_SCORE { newSilentSpace } \n ;\n\n /* - An alternative representation to support both pre and post embelishment operators. */\n Lit -> Lit POST_EMB { litWithPostEmb }\n | PreEmbLit\n ;\n\n PreEmbLit -> LitToken \n | LitToken CARET NUMBER { litWithCaret }\n | LitToken CARET STAR { litWithCaret }\n | PRE_EMB PreEmbLit { litWithPreEmb }\n ;\n \n LitToken -> DOTS_IDENT { litToAtom }\n | IDENT { litToAtom }\n | IDENT_DOTS { litToAtom }\n | STRING { litToAtom }\n ;\n\n Group -> OPEN_SQ Atoms CLOSE_SQ { newGroup };\n\n Duration -> Fraction | NUMBER;\n Fraction -> NUMBER SLASH NUMBER { newFraction } ;\n `,\n {\n allowLeftRecursion: true,\n debug: \"\",\n type: \"lalr\",\n tokenHandlers: {\n toEmbelishment: (token: TLEX.Token, tape: TLEX.Tape, owner: Parser) => {\n const [emb, pre] = owner.parseEmbelishment(token.value);\n if (emb == null) {\n console.log(\"Skipping Embelishment: \", token.value);\n owner.errors.push(\n new TLEX.TokenizerError(\n `Invalid embelishment: ${token.value}`,\n token.start,\n 1 + token.end - token.start,\n \"InvalidEmbelishment\",\n token.value,\n ),\n );\n return null;\n }\n token.value = emb;\n token.tag = pre ? \"PRE_EMB\" : \"POST_EMB\";\n return token;\n },\n toCommandName: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value.substring(1);\n return token;\n },\n toBoolean: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value == \"true\";\n return token;\n },\n toNumber: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = parseInt(token.value);\n return token;\n },\n toString: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value.substring(1, token.value.length - 1);\n return token;\n },\n toMarker: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n if (token.tag != \"PRE_MARKER\" && token.tag != \"POST_MARKER\") {\n throw new Error(\"Invalid token for converting to note: \" + token.tag);\n }\n const isBefore = token.tag == \"PRE_MARKER\";\n const markerText = isBefore\n ? token.value.substring(1, token.value.length - 3)\n : token.value.substring(3, token.value.length - 1);\n console.log(\"TokVal: \", token.value, token.positions);\n console.log(\"Marker Text: \", markerText, isBefore);\n token.value = new Marker(markerText, isBefore);\n return token;\n },\n toOctavedNote: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n if (token.tag == \"DOTS_IDENT\") {\n const octave = token.positions[1][1] - token.positions[1][0];\n const note = token.value.substring(octave);\n token.value = new Note(note, ONE, -octave);\n } else if (token.tag == \"IDENT_DOTS\") {\n const octave = token.positions[2][1] - token.positions[2][0];\n const note = token.value.substring(0, token.value.length - octave);\n token.value = new Note(note, ONE, octave);\n } else {\n throw new Error(\"Invalid token for converting to note: \" + token.tag);\n }\n return token;\n },\n toRoleSelector: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value.substring(0, token.value.length - 1);\n return token;\n },\n toLineAnnotation: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n // skip the initial \"!\"\n token.value = token.value.substring(1);\n return token;\n },\n toSingleLineRawString: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n // skip the initial \">\"\n token.value = token.value.substring(1);\n return token;\n },\n toMultiLineRawString: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n // consume everything until \"#<N times> as start\n const hashes = tape.substring(token.positions[1][0], token.positions[1][1]);\n const endPat = '\"' + hashes;\n const startPos = tape.index;\n const endPos = TLEX.TapeHelper.advanceAfter(tape, endPat) - endPat.length;\n if (endPos < 0) {\n throw new Error(\"EOF expected while finding end of Raw String Literal: '\" + endPat + \"'\");\n }\n token.value = tape.substring(startPos, endPos);\n return token;\n },\n },\n },\n);\n\n/**\n * A notation doc is a list of lines that are found in a single document.\n *\n * Since our document (md or html etc) can contain multiple snippets\n * all these snippets are related\n */\nexport class Parser {\n errors: TLEX.TokenizerError[] = [];\n readonly commands: Command[] = [];\n // readonly notation: Notation = new Notation();\n private runCommandFound = false;\n // readonly parseTree = new PTNodeList(\"Snippet\", null);\n\n protected ruleHandlers = {\n newFraction: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n if (children.length == 1) {\n return new TSU.Num.Fraction(children[0].value);\n } else {\n return new TSU.Num.Fraction(children[0].value, children[2].value);\n }\n },\n newGroup: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const out = new Group(...children[1].value).setDuration(TWO, true);\n return out;\n },\n litWithCaret: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const lit = Note.fromLit(children[0].value as Literal);\n const opnode = children[2];\n const shiftValue = opnode.sym.label == \"STAR\" ? true : opnode.value;\n lit.shift = shiftValue;\n return lit;\n },\n litWithPreEmb: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const emb = children[0];\n const lit = children[1].value as Literal;\n lit.embelishments.splice(0, 0, emb.value);\n return lit;\n },\n litWithPostEmb: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const lit = children[0].value as Literal;\n const emb = children[1];\n lit.embelishments.push(emb);\n return lit;\n },\n litToAtom: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const lit = children[0];\n if (lit.sym.label == \"DOTS_IDENT\" || lit.sym.label == \"IDENT_DOTS\") {\n return lit.value;\n } else if (lit.sym.label == \"IDENT\") {\n // Mark this as a Literal to be processed later\n return new Literal(lit.value);\n // return role.notesOnly ? new Note(lit.value) : new Syllable(lit.value);\n } else if (lit.sym.label == \"STRING\") {\n // const role = this.snippet.currRole;\n // if (role.notesOnly) throw new Error(\"Strings cannot appear in notes only mode\");\n return new Syllable(lit.value);\n } else {\n throw new Error(\"Invalid lit: \" + lit);\n }\n },\n newSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Space();\n },\n newRest: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Rest();\n },\n newDoubleSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Space(ONE.timesNum(2));\n },\n newSilentSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Space(ONE, true);\n },\n applyDuration: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n let dur = children[0].value as TSU.Num.Fraction | number;\n const leaf = children[1].value as Atom;\n if (typeof dur === \"number\") {\n dur = ONE.timesNum(dur);\n }\n if (leaf.type == AtomType.GROUP) {\n (leaf as Group).setDuration(dur, true);\n } else {\n leaf.duration = dur;\n }\n return leaf;\n },\n newArray: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n // create an array of values from all the values of child nodes\n return children.map((c) => c.value);\n },\n concatAtoms: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const atoms = children[0].value;\n const atom = children[1].value;\n atoms.push(atom);\n return atoms;\n },\n newParam: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n if (children.length == 1) {\n return { key: null, value: children[0].value };\n } else {\n return { key: children[0].value, value: children[2].value };\n }\n },\n newParamList: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return [children[0].value];\n },\n concatParamList: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const params = children[0].value;\n const newParam = children[2].value;\n params.push(newParam);\n return params;\n },\n newCommand: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return this.createCommand(children[0].value, children[1].value);\n },\n appendAtoms: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const atoms = children[0].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n appendCommand: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const command = children[1].value as Command;\n this.addCommand(command);\n\n const atoms = children[2].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n appendRoleSelector: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const roleName = children[1].value;\n const lName = roleName.toLowerCase().trim();\n this.addCommand(new ActivateRole([{ key: null, value: lName }]));\n\n const atoms = children[2].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n insertEmbedding: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n // How to handle embeddings - these are just blocks\n // to escape out of song (most likely for some rendering of html/md etc)\n const rawVal = children[1].value;\n this.addCommand(new RawEmbedding([{ key: null, value: rawVal }]));\n const atoms = children[2].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n };\n\n constructor(config?: any) {\n config = config || {};\n }\n\n createCommand(name: string, params: CmdParam[]): Command {\n const lName = name.trim().toLowerCase();\n params = params || [];\n if (lName == \"line\") {\n return new CreateLine(params);\n } else if (lName == \"meta\") {\n return new MetaData(params);\n } else if (lName == \"role\") {\n return new CreateRole(params);\n } else if (lName == \"layout\") {\n return new ApplyLayout(params);\n } else if (lName == \"beatduration\") {\n return new SetBeatDuration(params);\n } else if (lName == \"breaks\") {\n return new SetBreaks(params);\n } else if (lName == \"cycle\") {\n return new SetCycle(params);\n } else {\n // Try to set this as the current role\n throw new Error(\"Invalid command: \" + lName);\n }\n }\n\n addCommand(cmd: Command): void {\n cmd.index = this.commands.length;\n this.commands.push(cmd);\n }\n\n parse(input: string): any {\n this.errors = [];\n const ptree = parser.parse(input, {\n tokenizerContext: this,\n ruleHandlers: this.ruleHandlers,\n onTokenError: (err: TLEX.TokenizerError) => {\n this.errors.push(err);\n return true;\n },\n });\n return ptree;\n }\n\n parseEmbelishment(value: string): [any, boolean] {\n return carnatic.parseEmbelishment(value);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AACvC,0CAA4B;AAC5B,2CAA6B;AAC7B,iCAA6F;AAE7F,yCAWoB;AAGpB,qDAAuC;AAEvC,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;AACjC,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAW5B,MAAM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AAC,MAAM,CAAC,CAAC;SAC7B;aAAM;YAEL,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;SAC9C;IACH,CAAC;IAED,UAAU,CAAC,GAAY;QACrB,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED,KAAK,CAAC,KAAa;QACjB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE;YAChC,gBAAgB,EAAE,IAAI;YACtB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,YAAY,EAAE,CAAC,GAAwB,EAAE,EAAE;gBACzC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;QACH,OAAO,KAAK,CAAC;IACf,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,OAAO,QAAQ,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;CACF;AAxND,wBAwNC","sourcesContent":["import * as TSU from \"@panyam/tsutils\";\nimport * as G from \"galore\";\nimport * as TLEX from \"tlex\";\nimport { Literal, AtomType, Note, Atom, Rest, Space, Syllable, Group, Marker } from \"./core\";\nimport { Command, CmdParam } from \"./notation\";\nimport {\n RawEmbedding,\n ApplyLayout,\n AddAtoms,\n SetCycle,\n SetBeatDuration,\n SetBreaks,\n ActivateRole,\n CreateRole,\n CreateLine,\n MetaData,\n} from \"./commands\";\n\n// TODO - Make this plugable from the client instead of hard coded\nimport * as carnatic from \"./carnatic\";\n\nconst ONE = TSU.Num.Fraction.ONE;\nconst TWO = ONE.timesNum(2);\n\n/**\n * V4 of our parser builds on V3 and has the following improvements:\n *\n * 1. Embedding Headings to demarcate sections so users dont have to use\n * explicit MD for headings.\n * 2. Unlike V3 here users break out *of* song instead instead break out \"into\"\n * song. So users spend more time writing notation and less worrying about\n * other things like headings etc.\n */\nconst [parser, itemGraph] = G.newParser(\n String.raw`\n %define IdentChar /[^%!@&\\^|\\[\\]={}()+\\-,;~: \\t\\f\\r\\n\\v\\\\\\.]/\n\n %token BSLASH \"\\\\\"\n %token OPEN_SQ \"[\"\n %token CLOSE_SQ \"]\"\n %token EQUALS \"=\"\n %token OPEN_PAREN \"(\"\n %token CLOSE_PAREN \")\"\n %token OPEN_BRACE \"{\"\n %token CLOSE_BRACE \"}\"\n %token SLASH \"/\"\n %token STAR \"*\"\n %token CARET \"^\"\n // %skip \"-\"\n %token COMMA \",\"\n %token SEMI_COLON \";\"\n %token COLON \":\"\n\n %token SINGLE_LINE_RAW_STRING />(.*)$/m { toSingleLineRawString }\n %token MULTI_LINE_RAW_STRING /r(#{0,})\"/ { toMultiLineRawString }\n\n %token EMBELISHMENT /~[^\\s]*/ { toEmbelishment }\n %token NUMBER /-?\\d+/ { toNumber }\n %token BOOLEAN /true|false/ { toBoolean }\n %token POST_MARKER /<<\"(([^\"\\\\\\n]|\\\\.|\\\\\\n)*)\"/ { toMarker }\n %token POST_MARKER /<<'(([^'\\\\\\n]|\\\\.|\\\\\\n)*)'/ { toMarker }\n %token PRE_MARKER /\"(([^\"\\\\\\n]|\\\\.|\\\\\\n)*)\">>/ { toMarker }\n %token PRE_MARKER /'(([^'\\\\\\n]|\\\\.|\\\\\\n)*)'>>/ { toMarker }\n %token STRING /\"([^\"\\\\\\n]|\\\\.|\\\\\\n)*\"/ { toString }\n %token STRING /'([^'\\\\\\n]|\\\\.|\\\\\\n)*'/ { toString }\n %token DOTS_IDENT /(\\.+)({IdentChar}+)/ { toOctavedNote }\n %token IDENT_DOTS /({IdentChar}+)(\\.+)/ { toOctavedNote }\n %token IDENT_COLON /{IdentChar}+:/ { toRoleSelector }\n %token IDENT /{IdentChar}+/\n %token BSLASH_IDENT /\\\\{IDENT}/ { toCommandName }\n %token BSLASH_NUMBER /\\\\{NUMBER}/\n %token HYPHEN /-/\n %skip /[ \\t\\n\\f\\r]+/\n %skip_flex \"//.*$\"\n %skip /\\/\\*.*?\\*\\//\n\n Elements -> Elements Command Atoms { appendCommand } \n | Elements RoleSelector Atoms { appendRoleSelector } \n | Elements Embedding Atoms { insertEmbedding }\n | Atoms { appendAtoms }\n ;\n\n Embedding -> SINGLE_LINE_RAW_STRING | MULTI_LINE_RAW_STRING ;\n\n Command -> BSLASH_IDENT CommandParams ? { newCommand } ;\n CommandParams -> OPEN_PAREN ParamList ? CLOSE_PAREN { $2 } ;\n\n ParamList -> ParamList COMMA Param { concatParamList } ;\n ParamList -> Param { newParamList };\n Param -> ParamValue { newParam } ;\n Param -> ParamKey EQUALS ParamValue { newParam } ;\n ParamKey -> IDENT ;\n ParamValue -> ( STRING | Fraction | NUMBER | BOOLEAN ) ;\n\n RoleSelector -> IDENT_COLON ;\n\n Atoms -> Atoms Atom { concatAtoms } ;\n Atoms -> { newArray } ;\n\n Atom -> Duration Leaf { applyDuration } ;\n Atom -> PRE_MARKER Atom { applyPreMarker }\n | Atom POST_MARKER { applyPostMarker }\n ;\n Atom -> Leaf ;\n Leaf -> Space | Lit | Group | Rest ;\n Rest -> HYPHEN { newRest };\n\n Space -> COMMA { newSpace } \n | SEMI_COLON { newDoubleSpace } \n | UNDER_SCORE { newSilentSpace } \n ;\n\n /* - An alternative representation to support both pre and post embelishment operators. */\n Lit -> Lit POST_EMB { litWithPostEmb }\n | PreEmbLit\n ;\n\n PreEmbLit -> LitToken \n | LitToken CARET NUMBER { litWithCaret }\n | LitToken CARET STAR { litWithCaret }\n | PRE_EMB PreEmbLit { litWithPreEmb }\n ;\n \n LitToken -> DOTS_IDENT { litToAtom }\n | IDENT { litToAtom }\n | IDENT_DOTS { litToAtom }\n | STRING { litToAtom }\n ;\n\n Group -> OPEN_SQ Atoms CLOSE_SQ { newGroup };\n\n Duration -> Fraction | NUMBER;\n Fraction -> NUMBER SLASH NUMBER { newFraction } ;\n `,\n {\n allowLeftRecursion: true,\n debug: \"\",\n type: \"lalr\",\n tokenHandlers: {\n toEmbelishment: (token: TLEX.Token, tape: TLEX.Tape, owner: Parser) => {\n const [emb, pre] = owner.parseEmbelishment(token.value);\n if (emb == null) {\n console.log(\"Skipping Embelishment: \", token.value);\n owner.errors.push(\n new TLEX.TokenizerError(\n `Invalid embelishment: ${token.value}`,\n token.start,\n 1 + token.end - token.start,\n \"InvalidEmbelishment\",\n token.value,\n ),\n );\n return null;\n }\n token.value = emb;\n token.tag = pre ? \"PRE_EMB\" : \"POST_EMB\";\n return token;\n },\n toCommandName: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value.substring(1);\n return token;\n },\n toBoolean: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value == \"true\";\n return token;\n },\n toNumber: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = parseInt(token.value);\n return token;\n },\n toString: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value.substring(1, token.value.length - 1);\n return token;\n },\n toMarker: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n if (token.tag != \"PRE_MARKER\" && token.tag != \"POST_MARKER\") {\n throw new Error(\"Invalid token for converting to note: \" + token.tag);\n }\n const isBefore = token.tag == \"PRE_MARKER\";\n const markerText = isBefore\n ? token.value.substring(1, token.value.length - 3)\n : token.value.substring(3, token.value.length - 1);\n // console.log(\"TokVal: \", token.value, token.positions);\n // console.log(\"Marker Text: \", markerText, isBefore);\n token.value = new Marker(markerText, isBefore);\n return token;\n },\n toOctavedNote: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n if (token.tag == \"DOTS_IDENT\") {\n const octave = token.positions[1][1] - token.positions[1][0];\n const note = token.value.substring(octave);\n token.value = new Note(note, ONE, -octave);\n } else if (token.tag == \"IDENT_DOTS\") {\n const octave = token.positions[2][1] - token.positions[2][0];\n const note = token.value.substring(0, token.value.length - octave);\n token.value = new Note(note, ONE, octave);\n } else {\n throw new Error(\"Invalid token for converting to note: \" + token.tag);\n }\n return token;\n },\n toRoleSelector: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n token.value = token.value.substring(0, token.value.length - 1);\n return token;\n },\n toLineAnnotation: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n // skip the initial \"!\"\n token.value = token.value.substring(1);\n return token;\n },\n toSingleLineRawString: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n // skip the initial \">\"\n token.value = token.value.substring(1);\n return token;\n },\n toMultiLineRawString: (token: TLEX.Token, tape: TLEX.Tape, owner: any) => {\n // consume everything until \"#<N times> as start\n const hashes = tape.substring(token.positions[1][0], token.positions[1][1]);\n const endPat = '\"' + hashes;\n const startPos = tape.index;\n const endPos = TLEX.TapeHelper.advanceAfter(tape, endPat) - endPat.length;\n if (endPos < 0) {\n throw new Error(\"EOF expected while finding end of Raw String Literal: '\" + endPat + \"'\");\n }\n token.value = tape.substring(startPos, endPos);\n return token;\n },\n },\n },\n);\n\n/**\n * A notation doc is a list of lines that are found in a single document.\n *\n * Since our document (md or html etc) can contain multiple snippets\n * all these snippets are related\n */\nexport class Parser {\n errors: TLEX.TokenizerError[] = [];\n readonly commands: Command[] = [];\n // readonly notation: Notation = new Notation();\n private runCommandFound = false;\n // readonly parseTree = new PTNodeList(\"Snippet\", null);\n\n protected ruleHandlers = {\n newFraction: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n if (children.length == 1) {\n return new TSU.Num.Fraction(children[0].value);\n } else {\n return new TSU.Num.Fraction(children[0].value, children[2].value);\n }\n },\n newGroup: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const out = new Group(...children[1].value).setDuration(TWO, true);\n return out;\n },\n litWithCaret: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const lit = Note.fromLit(children[0].value as Literal);\n const opnode = children[2];\n const shiftValue = opnode.sym.label == \"STAR\" ? true : opnode.value;\n lit.shift = shiftValue;\n return lit;\n },\n litWithPreEmb: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const emb = children[0];\n const lit = children[1].value as Literal;\n lit.embelishments.splice(0, 0, emb.value);\n return lit;\n },\n litWithPostEmb: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const lit = children[0].value as Literal;\n const emb = children[1];\n lit.embelishments.push(emb);\n return lit;\n },\n litToAtom: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const lit = children[0];\n if (lit.sym.label == \"DOTS_IDENT\" || lit.sym.label == \"IDENT_DOTS\") {\n return lit.value;\n } else if (lit.sym.label == \"IDENT\") {\n // Mark this as a Literal to be processed later\n return new Literal(lit.value);\n // return role.notesOnly ? new Note(lit.value) : new Syllable(lit.value);\n } else if (lit.sym.label == \"STRING\") {\n // const role = this.snippet.currRole;\n // if (role.notesOnly) throw new Error(\"Strings cannot appear in notes only mode\");\n return new Syllable(lit.value);\n } else {\n throw new Error(\"Invalid lit: \" + lit);\n }\n },\n newSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Space();\n },\n newRest: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Rest();\n },\n newDoubleSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Space(ONE.timesNum(2));\n },\n newSilentSpace: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return new Space(ONE, true);\n },\n applyPreMarker: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const marker = children[0].value as Marker;\n const leaf = children[1].value as Atom;\n // console.log(\"marker, leaf: \", marker, leaf);\n if (!leaf.markersBefore) {\n leaf.markersBefore = [];\n }\n leaf.markersBefore.splice(0, 0, marker);\n return leaf;\n },\n applyPostMarker: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const leaf = children[0].value as Atom;\n const marker = children[1].value as Marker;\n if (!leaf.markersAfter) {\n leaf.markersAfter = [];\n }\n leaf.markersAfter.push(marker);\n return leaf;\n },\n applyDuration: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n let dur = children[0].value as TSU.Num.Fraction | number;\n const leaf = children[1].value as Atom;\n if (typeof dur === \"number\") {\n dur = ONE.timesNum(dur);\n }\n if (leaf.type == AtomType.GROUP) {\n (leaf as Group).setDuration(dur, true);\n } else {\n leaf.duration = dur;\n }\n return leaf;\n },\n newArray: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n // create an array of values from all the values of child nodes\n return children.map((c) => c.value);\n },\n concatAtoms: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const atoms = children[0].value;\n const atom = children[1].value;\n atoms.push(atom);\n return atoms;\n },\n newParam: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n if (children.length == 1) {\n return { key: null, value: children[0].value };\n } else {\n return { key: children[0].value, value: children[2].value };\n }\n },\n newParamList: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return [children[0].value];\n },\n concatParamList: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const params = children[0].value;\n const newParam = children[2].value;\n params.push(newParam);\n return params;\n },\n newCommand: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n return this.createCommand(children[0].value, children[1].value);\n },\n appendAtoms: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const atoms = children[0].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n appendCommand: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const command = children[1].value as Command;\n this.addCommand(command);\n\n const atoms = children[2].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n appendRoleSelector: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n const roleName = children[1].value;\n const lName = roleName.toLowerCase().trim();\n this.addCommand(new ActivateRole([{ key: null, value: lName }]));\n\n const atoms = children[2].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n insertEmbedding: (rule: G.Rule, parent: G.PTNode, ...children: G.PTNode[]) => {\n // How to handle embeddings - these are just blocks\n // to escape out of song (most likely for some rendering of html/md etc)\n const rawVal = children[1].value;\n this.addCommand(new RawEmbedding([{ key: null, value: rawVal }]));\n const atoms = children[2].value as Atom[];\n if (atoms.length > 0) {\n this.addCommand(new AddAtoms(...atoms));\n }\n return null;\n },\n };\n\n constructor(config?: any) {\n config = config || {};\n }\n\n createCommand(name: string, params: CmdParam[]): Command {\n const lName = name.trim().toLowerCase();\n params = params || [];\n if (lName == \"line\") {\n return new CreateLine(params);\n } else if (lName == \"meta\") {\n return new MetaData(params);\n } else if (lName == \"role\") {\n return new CreateRole(params);\n } else if (lName == \"layout\") {\n return new ApplyLayout(params);\n } else if (lName == \"beatduration\") {\n return new SetBeatDuration(params);\n } else if (lName == \"breaks\") {\n return new SetBreaks(params);\n } else if (lName == \"cycle\") {\n return new SetCycle(params);\n } else {\n // Try to set this as the current role\n throw new Error(\"Invalid command: \" + lName);\n }\n }\n\n addCommand(cmd: Command): void {\n cmd.index = this.commands.length;\n this.commands.push(cmd);\n }\n\n parse(input: string): any {\n this.errors = [];\n const ptree = parser.parse(input, {\n tokenizerContext: this,\n ruleHandlers: this.ruleHandlers,\n onTokenError: (err: TLEX.TokenizerError) => {\n this.errors.push(err);\n return true;\n },\n });\n return ptree;\n }\n\n parseEmbelishment(value: string): [any, boolean] {\n return carnatic.parseEmbelishment(value);\n }\n}\n"]}
|
package/lib/cjs/shapes.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
3
|
if (k2 === undefined) k2 = k;
|
|
19
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -37,38 +22,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
37
22
|
__setModuleDefault(result, mod);
|
|
38
23
|
return result;
|
|
39
24
|
};
|
|
40
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
41
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
42
|
-
if (!m) return o;
|
|
43
|
-
var i = m.call(o), r, ar = [], e;
|
|
44
|
-
try {
|
|
45
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
46
|
-
}
|
|
47
|
-
catch (error) { e = { error: error }; }
|
|
48
|
-
finally {
|
|
49
|
-
try {
|
|
50
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
51
|
-
}
|
|
52
|
-
finally { if (e) throw e.error; }
|
|
53
|
-
}
|
|
54
|
-
return ar;
|
|
55
|
-
};
|
|
56
|
-
var __values = (this && this.__values) || function(o) {
|
|
57
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
58
|
-
if (m) return m.call(o);
|
|
59
|
-
if (o && typeof o.length === "number") return {
|
|
60
|
-
next: function () {
|
|
61
|
-
if (o && i >= o.length) o = void 0;
|
|
62
|
-
return { value: o && o[i++], done: !o };
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
66
|
-
};
|
|
67
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
26
|
exports.GroupView = exports.LeafAtomView = exports.AtomView = exports.ElementShape = exports.Embelishment = exports.Shape = void 0;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
27
|
+
const TSU = __importStar(require("@panyam/tsutils"));
|
|
28
|
+
class Shape {
|
|
29
|
+
constructor() {
|
|
72
30
|
this.shapeId = Shape.idCounter++;
|
|
73
31
|
this._x = null;
|
|
74
32
|
this._y = null;
|
|
@@ -77,32 +35,23 @@ var Shape = (function () {
|
|
|
77
35
|
this.parentShape = null;
|
|
78
36
|
this.children = [];
|
|
79
37
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this._minSize = this.refreshMinSize();
|
|
94
|
-
}
|
|
95
|
-
return this._minSize;
|
|
96
|
-
},
|
|
97
|
-
enumerable: false,
|
|
98
|
-
configurable: true
|
|
99
|
-
});
|
|
100
|
-
Shape.prototype.invalidateBounds = function () {
|
|
38
|
+
get bbox() {
|
|
39
|
+
if (!this._bbox) {
|
|
40
|
+
this._bbox = this.refreshBBox();
|
|
41
|
+
}
|
|
42
|
+
return this._bbox;
|
|
43
|
+
}
|
|
44
|
+
get minSize() {
|
|
45
|
+
if (!this._minSize) {
|
|
46
|
+
this._minSize = this.refreshMinSize();
|
|
47
|
+
}
|
|
48
|
+
return this._minSize;
|
|
49
|
+
}
|
|
50
|
+
invalidateBounds() {
|
|
101
51
|
this._minSize = null;
|
|
102
52
|
this._bbox = null;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (applyLayout === void 0) { applyLayout = false; }
|
|
53
|
+
}
|
|
54
|
+
setBounds(x, y, w, h, applyLayout = false) {
|
|
106
55
|
if (x != null) {
|
|
107
56
|
if (isNaN(x)) {
|
|
108
57
|
this._x = null;
|
|
@@ -135,7 +84,7 @@ var Shape = (function () {
|
|
|
135
84
|
this._height = h;
|
|
136
85
|
}
|
|
137
86
|
}
|
|
138
|
-
|
|
87
|
+
const [nx, ny, nw, nh] = this.updateBounds(x, y, w, h);
|
|
139
88
|
if (nx != null) {
|
|
140
89
|
if (isNaN(nx)) {
|
|
141
90
|
this._x = null;
|
|
@@ -171,166 +120,112 @@ var Shape = (function () {
|
|
|
171
120
|
if (applyLayout)
|
|
172
121
|
this.refreshLayout();
|
|
173
122
|
return [nx, ny, nw, nh];
|
|
174
|
-
};
|
|
175
|
-
Object.defineProperty(Shape.prototype, "hasX", {
|
|
176
|
-
get: function () {
|
|
177
|
-
return this._x != null && !isNaN(this._x);
|
|
178
|
-
},
|
|
179
|
-
enumerable: false,
|
|
180
|
-
configurable: true
|
|
181
|
-
});
|
|
182
|
-
Object.defineProperty(Shape.prototype, "hasY", {
|
|
183
|
-
get: function () {
|
|
184
|
-
return this._y != null && !isNaN(this._y);
|
|
185
|
-
},
|
|
186
|
-
enumerable: false,
|
|
187
|
-
configurable: true
|
|
188
|
-
});
|
|
189
|
-
Object.defineProperty(Shape.prototype, "hasWidth", {
|
|
190
|
-
get: function () {
|
|
191
|
-
return this._width != null && !isNaN(this._width);
|
|
192
|
-
},
|
|
193
|
-
enumerable: false,
|
|
194
|
-
configurable: true
|
|
195
|
-
});
|
|
196
|
-
Object.defineProperty(Shape.prototype, "hasHeight", {
|
|
197
|
-
get: function () {
|
|
198
|
-
return this._height != null && !isNaN(this._height);
|
|
199
|
-
},
|
|
200
|
-
enumerable: false,
|
|
201
|
-
configurable: true
|
|
202
|
-
});
|
|
203
|
-
Object.defineProperty(Shape.prototype, "x", {
|
|
204
|
-
get: function () {
|
|
205
|
-
return this._x || 0;
|
|
206
|
-
},
|
|
207
|
-
set: function (x) {
|
|
208
|
-
this.setBounds(x == null ? NaN : x, null, null, null);
|
|
209
|
-
},
|
|
210
|
-
enumerable: false,
|
|
211
|
-
configurable: true
|
|
212
|
-
});
|
|
213
|
-
Object.defineProperty(Shape.prototype, "y", {
|
|
214
|
-
get: function () {
|
|
215
|
-
if (this._y != null)
|
|
216
|
-
return this._y;
|
|
217
|
-
return 0;
|
|
218
|
-
},
|
|
219
|
-
set: function (y) {
|
|
220
|
-
this.setBounds(null, y == null ? NaN : y, null, null);
|
|
221
|
-
},
|
|
222
|
-
enumerable: false,
|
|
223
|
-
configurable: true
|
|
224
|
-
});
|
|
225
|
-
Object.defineProperty(Shape.prototype, "width", {
|
|
226
|
-
get: function () {
|
|
227
|
-
if (this._width != null)
|
|
228
|
-
return this._width;
|
|
229
|
-
return 0;
|
|
230
|
-
},
|
|
231
|
-
set: function (w) {
|
|
232
|
-
this.setBounds(null, null, w == null ? NaN : w, null);
|
|
233
|
-
},
|
|
234
|
-
enumerable: false,
|
|
235
|
-
configurable: true
|
|
236
|
-
});
|
|
237
|
-
Object.defineProperty(Shape.prototype, "height", {
|
|
238
|
-
get: function () {
|
|
239
|
-
if (this._height != null)
|
|
240
|
-
return this._height;
|
|
241
|
-
return 0;
|
|
242
|
-
},
|
|
243
|
-
set: function (h) {
|
|
244
|
-
this.setBounds(null, null, null, h == null ? NaN : h);
|
|
245
|
-
},
|
|
246
|
-
enumerable: false,
|
|
247
|
-
configurable: true
|
|
248
|
-
});
|
|
249
|
-
Shape.prototype.refreshLayout = function () {
|
|
250
|
-
};
|
|
251
|
-
Shape.idCounter = 0;
|
|
252
|
-
return Shape;
|
|
253
|
-
}());
|
|
254
|
-
exports.Shape = Shape;
|
|
255
|
-
var Embelishment = (function (_super) {
|
|
256
|
-
__extends(Embelishment, _super);
|
|
257
|
-
function Embelishment() {
|
|
258
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
259
123
|
}
|
|
260
|
-
|
|
261
|
-
|
|
124
|
+
get hasX() {
|
|
125
|
+
return this._x != null && !isNaN(this._x);
|
|
126
|
+
}
|
|
127
|
+
get hasY() {
|
|
128
|
+
return this._y != null && !isNaN(this._y);
|
|
129
|
+
}
|
|
130
|
+
get hasWidth() {
|
|
131
|
+
return this._width != null && !isNaN(this._width);
|
|
132
|
+
}
|
|
133
|
+
get hasHeight() {
|
|
134
|
+
return this._height != null && !isNaN(this._height);
|
|
135
|
+
}
|
|
136
|
+
get x() {
|
|
137
|
+
return this._x || 0;
|
|
138
|
+
}
|
|
139
|
+
set x(x) {
|
|
140
|
+
this.setBounds(x == null ? NaN : x, null, null, null);
|
|
141
|
+
}
|
|
142
|
+
get y() {
|
|
143
|
+
if (this._y != null)
|
|
144
|
+
return this._y;
|
|
145
|
+
return 0;
|
|
146
|
+
}
|
|
147
|
+
set y(y) {
|
|
148
|
+
this.setBounds(null, y == null ? NaN : y, null, null);
|
|
149
|
+
}
|
|
150
|
+
get width() {
|
|
151
|
+
if (this._width != null)
|
|
152
|
+
return this._width;
|
|
153
|
+
return 0;
|
|
154
|
+
}
|
|
155
|
+
set width(w) {
|
|
156
|
+
this.setBounds(null, null, w == null ? NaN : w, null);
|
|
157
|
+
}
|
|
158
|
+
get height() {
|
|
159
|
+
if (this._height != null)
|
|
160
|
+
return this._height;
|
|
161
|
+
return 0;
|
|
162
|
+
}
|
|
163
|
+
set height(h) {
|
|
164
|
+
this.setBounds(null, null, null, h == null ? NaN : h);
|
|
165
|
+
}
|
|
166
|
+
refreshLayout() {
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
exports.Shape = Shape;
|
|
170
|
+
Shape.idCounter = 0;
|
|
171
|
+
class Embelishment extends Shape {
|
|
172
|
+
}
|
|
262
173
|
exports.Embelishment = Embelishment;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
ElementShape.prototype.refreshBBox = function () {
|
|
174
|
+
class ElementShape extends Shape {
|
|
175
|
+
constructor(element) {
|
|
176
|
+
super();
|
|
177
|
+
this.element = element;
|
|
178
|
+
}
|
|
179
|
+
refreshBBox() {
|
|
271
180
|
return TSU.DOM.svgBBox(this.element);
|
|
272
|
-
}
|
|
273
|
-
|
|
181
|
+
}
|
|
182
|
+
refreshMinSize() {
|
|
274
183
|
return TSU.DOM.svgBBox(this.element);
|
|
275
|
-
}
|
|
276
|
-
|
|
184
|
+
}
|
|
185
|
+
updateBounds(x, y, w, h) {
|
|
277
186
|
return [x, y, w, h];
|
|
278
|
-
}
|
|
279
|
-
|
|
187
|
+
}
|
|
188
|
+
refreshLayout() {
|
|
280
189
|
if (this.hasX)
|
|
281
190
|
this.element.setAttribute("x", "" + this._x);
|
|
282
191
|
if (this.hasY)
|
|
283
192
|
this.element.setAttribute("y", "" + this._y);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
}(Shape));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
287
195
|
exports.ElementShape = ElementShape;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
return AtomView;
|
|
297
|
-
}(Shape));
|
|
196
|
+
class AtomView extends Shape {
|
|
197
|
+
constructor() {
|
|
198
|
+
super(...arguments);
|
|
199
|
+
this.depth = 0;
|
|
200
|
+
this.roleIndex = 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
298
203
|
exports.AtomView = AtomView;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
LeafAtomView.prototype.isLeaf = function () {
|
|
204
|
+
class LeafAtomView extends AtomView {
|
|
205
|
+
constructor(leafAtom) {
|
|
206
|
+
super();
|
|
207
|
+
this.leafAtom = leafAtom;
|
|
208
|
+
}
|
|
209
|
+
isLeaf() {
|
|
307
210
|
return true;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
enumerable: false,
|
|
314
|
-
configurable: true
|
|
315
|
-
});
|
|
316
|
-
return LeafAtomView;
|
|
317
|
-
}(AtomView));
|
|
211
|
+
}
|
|
212
|
+
get viewId() {
|
|
213
|
+
return this.leafAtom.uuid;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
318
216
|
exports.LeafAtomView = LeafAtomView;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
GroupView.prototype.createElements = function (parent) {
|
|
333
|
-
var e_1, _a;
|
|
217
|
+
class GroupView extends AtomView {
|
|
218
|
+
constructor(group, config) {
|
|
219
|
+
super();
|
|
220
|
+
this.group = group;
|
|
221
|
+
this.atomViews = [];
|
|
222
|
+
this.defaultToNotes = true;
|
|
223
|
+
this.needsLayout = true;
|
|
224
|
+
this.scaleFactor = 1.0;
|
|
225
|
+
this.atomSpacing = 5;
|
|
226
|
+
this.setStyles(config || {});
|
|
227
|
+
}
|
|
228
|
+
createElements(parent) {
|
|
334
229
|
this.groupElement = TSU.DOM.createSVGNode("g", {
|
|
335
230
|
parent: parent,
|
|
336
231
|
attrs: {
|
|
@@ -338,91 +233,62 @@ var GroupView = (function (_super) {
|
|
|
338
233
|
id: "groupViewRoot" + this.group.uuid,
|
|
339
234
|
},
|
|
340
235
|
});
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
var atomView = this.createAtomView(atom);
|
|
345
|
-
this.atomViews.push(atomView);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
349
|
-
finally {
|
|
350
|
-
try {
|
|
351
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
352
|
-
}
|
|
353
|
-
finally { if (e_1) throw e_1.error; }
|
|
236
|
+
for (const atom of this.group.atoms.values()) {
|
|
237
|
+
const atomView = this.createAtomView(atom);
|
|
238
|
+
this.atomViews.push(atomView);
|
|
354
239
|
}
|
|
355
240
|
this.invalidateBounds();
|
|
356
|
-
}
|
|
357
|
-
|
|
241
|
+
}
|
|
242
|
+
isLeaf() {
|
|
358
243
|
return false;
|
|
359
|
-
}
|
|
360
|
-
|
|
244
|
+
}
|
|
245
|
+
refreshBBox() {
|
|
361
246
|
return TSU.DOM.svgBBox(this.groupElement);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
totalWidth += ms.width + _this.atomSpacing;
|
|
247
|
+
}
|
|
248
|
+
refreshMinSize() {
|
|
249
|
+
let totalWidth = 0;
|
|
250
|
+
let maxHeight = 0;
|
|
251
|
+
this.atomViews.forEach((av, index) => {
|
|
252
|
+
const ms = av.minSize;
|
|
253
|
+
totalWidth += ms.width + this.atomSpacing;
|
|
370
254
|
maxHeight = Math.max(maxHeight, ms.height);
|
|
371
255
|
});
|
|
372
256
|
return new TSU.Geom.Size(totalWidth * this.scaleFactor, maxHeight * this.scaleFactor);
|
|
373
|
-
}
|
|
374
|
-
|
|
257
|
+
}
|
|
258
|
+
updateBounds(x, y, w, h) {
|
|
375
259
|
return [x, y, w, h];
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
var _this = this;
|
|
380
|
-
var transform = "translate(" + this.x + "," + this.y + ")";
|
|
260
|
+
}
|
|
261
|
+
refreshLayout() {
|
|
262
|
+
let transform = "translate(" + this.x + "," + this.y + ")";
|
|
381
263
|
if (this.scaleFactor < 1) {
|
|
382
264
|
transform += " scale(" + this.scaleFactor + ")";
|
|
383
265
|
}
|
|
384
266
|
this.groupElement.setAttribute("transform", transform);
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
this.atomViews.forEach(
|
|
267
|
+
let currX = 0;
|
|
268
|
+
const currY = 0;
|
|
269
|
+
this.atomViews.forEach((av, index) => {
|
|
388
270
|
av.setBounds(currX, currY, null, null, true);
|
|
389
|
-
currX +=
|
|
271
|
+
currX += this.atomSpacing + av.minSize.width;
|
|
390
272
|
});
|
|
391
273
|
this.invalidateBounds();
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
var e = _c.value;
|
|
395
|
-
e.refreshLayout();
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
399
|
-
finally {
|
|
400
|
-
try {
|
|
401
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
402
|
-
}
|
|
403
|
-
finally { if (e_2) throw e_2.error; }
|
|
404
|
-
}
|
|
274
|
+
for (const e of this.embelishments)
|
|
275
|
+
e.refreshLayout();
|
|
405
276
|
this.invalidateBounds();
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
enumerable: false,
|
|
415
|
-
configurable: true
|
|
416
|
-
});
|
|
417
|
-
GroupView.prototype.createEmbelishments = function () {
|
|
277
|
+
}
|
|
278
|
+
get embelishments() {
|
|
279
|
+
if (!this._embelishments) {
|
|
280
|
+
this._embelishments = this.createEmbelishments();
|
|
281
|
+
}
|
|
282
|
+
return this._embelishments;
|
|
283
|
+
}
|
|
284
|
+
createEmbelishments() {
|
|
418
285
|
return [];
|
|
419
|
-
}
|
|
420
|
-
|
|
286
|
+
}
|
|
287
|
+
setStyles(config) {
|
|
421
288
|
if ("atomSpacing" in config)
|
|
422
289
|
this.atomSpacing = config.atomSpacing;
|
|
423
290
|
this.needsLayout = true;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
}(AtomView));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
427
293
|
exports.GroupView = GroupView;
|
|
428
294
|
//# sourceMappingURL=shapes.js.map
|