@jinntec/jinntap 1.28.0 → 1.28.1

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/README.md CHANGED
@@ -9,7 +9,7 @@ JinnTap comes as a web component. While it can be used standalone, it is usually
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- npm install jinn-tap
12
+ npm install @jinntec/jinntap
13
13
  ```
14
14
 
15
15
  ## Development Setup
@@ -61,7 +61,11 @@ npm run cypress:run
61
61
  <head>
62
62
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
63
63
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
64
- <script type="module" src="node_modules/jinn-tap/dist/jinn-tap.es.js"></script>
64
+ <!-- Import the general editor styles-->
65
+ <link rel="stylesheet" href="node_modules/@jinntec/jinntap/dist/jinn-tap.css" />
66
+ <!-- Import the styles for displaying TEI documents -->
67
+ <link rel="stylesheet" href="node_modules/@jinntec/jinntap/dist/editor-styles.css" />
68
+ <script type="module" src="node_modules/@jinntec/jinntap/dist/jinn-tap.es.js"></script>
65
69
  </head>
66
70
  <body>
67
71
  <jinn-tap></jinn-tap>
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -36202,11 +36202,11 @@ declare function jt:import ($doc as node()) {
36202
36202
  else
36203
36203
  $doc//tei:body/node()
36204
36204
  return (
36205
- jt:import($xml, false()),
36206
- <tei-listAnnotation>
36207
- { jt:import($doc//tei:standOff/tei:listAnnotation/tei:note, true()), jt:import($xml//tei:note, true()) }
36208
- </tei-listAnnotation>
36209
- )
36205
+ jt:import($xml, false()),
36206
+ <tei-listAnnotation>
36207
+ { jt:import($doc//tei:standOff/tei:listAnnotation/tei:note, true()), jt:import($xml//tei:note, true()) }
36208
+ </tei-listAnnotation>
36209
+ )
36210
36210
  };
36211
36211
 
36212
36212
  declare %private function jt:transform-to-same-node ($node as node(), $importNotes as xs:boolean) as node()* {
@@ -36223,96 +36223,92 @@ declare %private function jt:transform-to-same-node ($node as node(), $importNot
36223
36223
  declare function jt:import ($nodes as node()*, $importNotes as xs:boolean) {
36224
36224
  for $node in $nodes
36225
36225
  return typeswitch ($node)
36226
- case element(tei:listAnnotation) return
36227
- ()
36228
- case element(tei:note) return
36229
- if ($importNotes) then
36230
- <tei-note
36231
- n="{$node/@n}"
36232
- target="{
36233
- if ($node/@target) then
36234
- $node/@target
36235
- else (
36236
- '#' || generate-id($node)
36237
- )
36238
- }"
36239
- type="note"
36240
- >{ jt:import($node/node(), false()) }</tei-note>
36241
- else
36242
- <tei-anchor
36243
- id="{
36244
- if ($node/@xml:id) then
36245
- $node/@xml:id
36246
- else
36247
- generate-id($node)
36248
- }" />
36249
- case element(tei:cell) return
36250
- (: If there is a pb element directly after the row, fold it into the first cell in the row :)
36251
- let $preceding-pb := $node/../preceding-sibling::*[1][self::tei:pb]
36252
- return if (empty($preceding-pb)) then (
36253
- jt:transform-to-same-node($node, $importNotes)
36254
- ) else (
36255
- <tei-cell>
36256
- { $node/@*, $preceding-pb, jt:import($node/node(), $importNotes) }
36257
- </tei-cell>
36258
- )
36259
- case element(tei:pb) return
36260
- if ($node/parent::tei:table) then (
36261
- (: Remove the pb element, it's folded into the row :)
36262
- ) else (
36263
- jt:transform-to-same-node($node, $importNotes)
36264
- )
36265
- case element() return
36226
+ case element(tei:listAnnotation) return
36227
+ ()
36228
+ case element(tei:note) return
36229
+ if ($importNotes) then
36230
+ <tei-note
36231
+ n="{ $node/@n }"
36232
+ target="{
36233
+ if ($node/@target) then
36234
+ $node/@target
36235
+ else (
36236
+ '#' || generate-id($node)
36237
+ )
36238
+ }"
36239
+ type="note"
36240
+ >{ jt:import($node/node(), false()) }</tei-note>
36241
+ else
36242
+ <tei-anchor
36243
+ id="{
36244
+ if ($node/@xml:id) then
36245
+ $node/@xml:id
36246
+ else
36247
+ generate-id($node)
36248
+ }" />
36249
+ case element(tei:cell) return
36250
+ (: If there is a pb element directly after the row, fold it into the first cell in the row :)
36251
+ let $preceding-pb := $node/../preceding-sibling::*[1][self::tei:pb]
36252
+ return if (empty($preceding-pb)) then (
36266
36253
  jt:transform-to-same-node($node, $importNotes)
36254
+ ) else (
36255
+ <tei-cell>{ $node/@*, $preceding-pb, jt:import($node/node(), $importNotes) }</tei-cell>
36256
+ )
36257
+ case element(tei:pb) return
36258
+ if ($node/parent::tei:table) then (
36259
+ (: Remove the pb element, it's folded into the row :)
36260
+ ) else (
36261
+ jt:transform-to-same-node($node, $importNotes)
36262
+ )
36263
+ case element() return
36264
+ jt:transform-to-same-node($node, $importNotes)
36267
36265
 
36268
- default return
36269
- $node
36266
+ default return
36267
+ $node
36270
36268
  };
36271
36269
 
36272
36270
  declare function jt:export ($nodes as node()*, $input as document-node(), $meta as map(*)) {
36273
36271
  for $node in $nodes
36274
36272
  return typeswitch ($node)
36275
- case document-node() return
36276
- jt:export($node/node(), $input, $meta)
36277
- case element(tei:TEI) return
36278
- element {node-name($node)} {
36279
- $node/@*,
36280
- jt:export($node/tei:teiHeader, $input, $meta),
36281
- jt:export($node/tei:text, $input, $meta),
36282
- if (not($node/tei:standOff)) then
36283
- <standOff xmlns="http://www.tei-c.org/ns/1.0">{ $input//tei:listAnnotation }</standOff>
36284
- else (
36285
- ),
36286
- jt:export($node/tei:standOff, $input, $meta)
36287
- }
36288
- case element(tei:standOff) return
36289
- element {node-name($node)} {
36290
- $node/@*, $node/* except $node/tei:listAnnotation, $input//tei:listAnnotation
36291
- }
36292
- case element(tei:body) return
36293
- element {node-name($node)} {
36294
- $node/@*,
36295
- let $contents := $input/tei:body/node() except $input/tei:body/tei:listAnnotation
36296
- return jt:export($contents, $input, $meta)
36297
- }
36298
- case element(tei:title) return
36299
- element {node-name($node)} {
36300
- $node/@*,
36301
- if ($node/ancestor::tei:titleStmt and map:contains($meta, 'title')) then
36302
- $meta?title
36303
- else
36304
- jt:export($node/node(), $input, $meta)
36305
- }
36306
- case element(tei:cell) return
36307
- element {node-name($node)} {
36308
- (: Filter out rowspan and colspan. They are added while the TEI table is an HTML table :)
36309
- $node/@* except $node/(@colspan, @rowspan), jt:export($node/node(), $input, $meta)
36310
- }
36311
- case element() return
36312
- element {node-name($node)} { $node/@*, jt:export($node/node(), $input, $meta) }
36273
+ case document-node() return
36274
+ jt:export($node/node(), $input, $meta)
36275
+ case element(tei:TEI) return
36276
+ element {node-name($node)} {
36277
+ $node/@*,
36278
+ for $child in $node!(tei:teiHeader, tei:text, tei:facsimile, tei:sourceDoc)
36279
+ return jt:export($child, $input, $meta),
36280
+ if (not($node/tei:standOff)) then
36281
+ <standOff xmlns="http://www.tei-c.org/ns/1.0">{ $input//tei:listAnnotation }</standOff>
36282
+ else (
36283
+ ),
36284
+ jt:export($node/tei:standOff, $input, $meta)
36285
+ }
36286
+ case element(tei:standOff) return
36287
+ element {node-name($node)} { $node/@*, $node/* except $node/tei:listAnnotation, $input//tei:listAnnotation }
36288
+ case element(tei:body) return
36289
+ element {node-name($node)} {
36290
+ $node/@*,
36291
+ let $contents := $input/tei:body/node() except $input/tei:body/tei:listAnnotation
36292
+ return jt:export($contents, $input, $meta)
36293
+ }
36294
+ case element(tei:title) return
36295
+ element {node-name($node)} {
36296
+ $node/@*,
36297
+ if ($node/ancestor::tei:titleStmt and map:contains($meta, 'title')) then
36298
+ $meta?title
36299
+ else
36300
+ jt:export($node/node(), $input, $meta)
36301
+ }
36302
+ case element(tei:cell) return
36303
+ element {node-name($node)} {
36304
+ (: Filter out rowspan and colspan. They are added while the TEI table is an HTML table :)
36305
+ $node/@* except $node/(@colspan, @rowspan), jt:export($node/node(), $input, $meta)
36306
+ }
36307
+ case element() return
36308
+ element {node-name($node)} { $node/@*, jt:export($node/node(), $input, $meta) }
36313
36309
 
36314
- default return
36315
- $node
36310
+ default return
36311
+ $node
36316
36312
  };
36317
36313
  `;
36318
36314
  I9(M9);