@xpert-ai/plugin-motion 0.2.0 → 0.3.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.
Files changed (157) hide show
  1. package/.xpertai-plugin/plugin.json +16 -6
  2. package/README.md +19 -5
  3. package/assets/upstream/UPSTREAM-BASELINE.md +27 -0
  4. package/assets/upstream/app/data/reicon-LICENSE.txt +21 -0
  5. package/dist/assets/upstream/UPSTREAM-BASELINE.md +27 -0
  6. package/dist/assets/upstream/app/data/reicon-LICENSE.txt +21 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +18 -9
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/constants.d.ts +7 -1
  12. package/dist/lib/constants.d.ts.map +1 -1
  13. package/dist/lib/constants.js +7 -0
  14. package/dist/lib/constants.js.map +1 -1
  15. package/dist/lib/entities/motion-export.entity.d.ts +13 -1
  16. package/dist/lib/entities/motion-export.entity.d.ts.map +1 -1
  17. package/dist/lib/entities/motion-export.entity.js +49 -1
  18. package/dist/lib/entities/motion-export.entity.js.map +1 -1
  19. package/dist/lib/entities/motion-project-version.entity.d.ts +3 -1
  20. package/dist/lib/entities/motion-project-version.entity.d.ts.map +1 -1
  21. package/dist/lib/entities/motion-project-version.entity.js +8 -0
  22. package/dist/lib/entities/motion-project-version.entity.js.map +1 -1
  23. package/dist/lib/entities/motion-project.entity.d.ts +4 -1
  24. package/dist/lib/entities/motion-project.entity.d.ts.map +1 -1
  25. package/dist/lib/entities/motion-project.entity.js +8 -0
  26. package/dist/lib/entities/motion-project.entity.js.map +1 -1
  27. package/dist/lib/hyperframes-composition.d.ts +16 -0
  28. package/dist/lib/hyperframes-composition.d.ts.map +1 -0
  29. package/dist/lib/hyperframes-composition.js +106 -0
  30. package/dist/lib/hyperframes-composition.js.map +1 -0
  31. package/dist/lib/motion-agent-response.d.ts +8 -0
  32. package/dist/lib/motion-agent-response.d.ts.map +1 -1
  33. package/dist/lib/motion-agent-response.js +13 -0
  34. package/dist/lib/motion-agent-response.js.map +1 -1
  35. package/dist/lib/motion-render.processor.d.ts +9 -0
  36. package/dist/lib/motion-render.processor.d.ts.map +1 -0
  37. package/dist/lib/motion-render.processor.js +25 -0
  38. package/dist/lib/motion-render.processor.js.map +1 -0
  39. package/dist/lib/motion-view.provider.d.ts.map +1 -1
  40. package/dist/lib/motion-view.provider.js +31 -2
  41. package/dist/lib/motion-view.provider.js.map +1 -1
  42. package/dist/lib/motion.middleware.d.ts.map +1 -1
  43. package/dist/lib/motion.middleware.js +20 -6
  44. package/dist/lib/motion.middleware.js.map +1 -1
  45. package/dist/lib/motion.plugin.d.ts.map +1 -1
  46. package/dist/lib/motion.plugin.js +2 -1
  47. package/dist/lib/motion.plugin.js.map +1 -1
  48. package/dist/lib/motion.service.d.ts +174 -3
  49. package/dist/lib/motion.service.d.ts.map +1 -1
  50. package/dist/lib/motion.service.js +376 -19
  51. package/dist/lib/motion.service.js.map +1 -1
  52. package/dist/lib/remote-components/motion-workbench/app.css +1 -1
  53. package/dist/lib/remote-components/motion-workbench/app.js +553 -38
  54. package/dist/lib/types.d.ts +26 -1
  55. package/dist/lib/types.d.ts.map +1 -1
  56. package/dist/lib/types.js.map +1 -1
  57. package/dist/sandbox-actions/hyperframes-render/action.json +10 -0
  58. package/dist/sandbox-actions/hyperframes-render/bundle/runner.mjs +188 -0
  59. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@esbuild/darwin-arm64/README.md +3 -0
  60. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  61. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@esbuild/darwin-arm64/package.json +20 -0
  62. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@esbuild/linux-x64/README.md +3 -0
  63. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@esbuild/linux-x64/bin/esbuild +0 -0
  64. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@esbuild/linux-x64/package.json +20 -0
  65. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/LICENSE +190 -0
  66. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/README.md +156 -0
  67. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/dist/distributed.js +156122 -0
  68. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/dist/hyperframe.manifest.json +22 -0
  69. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/dist/hyperframe.runtime.iife.js +356 -0
  70. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/dist/index.js +169375 -0
  71. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/dist/public-server.js +167618 -0
  72. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/dist/services/healthWorkerThread.js +53 -0
  73. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/dist/services/shaderTransitionWorker.js +606 -0
  74. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/@hyperframes/producer/package.json +109 -0
  75. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/esbuild/LICENSE.md +21 -0
  76. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/esbuild/README.md +3 -0
  77. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/esbuild/bin/esbuild +0 -0
  78. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/esbuild/install.js +289 -0
  79. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/esbuild/lib/main.js +2532 -0
  80. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/esbuild/package.json +49 -0
  81. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/LICENSE +20 -0
  82. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/README.md +36 -0
  83. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/async/index.browser.cjs +42 -0
  84. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/async/index.browser.js +42 -0
  85. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/async/index.cjs +44 -0
  86. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/async/index.js +44 -0
  87. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/async/index.native.js +35 -0
  88. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/async/package.json +12 -0
  89. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/bin/nanoid.cjs +55 -0
  90. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/index.browser.cjs +44 -0
  91. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/index.browser.js +44 -0
  92. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/index.cjs +57 -0
  93. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/index.d.cts +91 -0
  94. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/index.js +62 -0
  95. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/nanoid.js +1 -0
  96. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/non-secure/index.cjs +24 -0
  97. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/non-secure/index.js +24 -0
  98. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/non-secure/package.json +6 -0
  99. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/package.json +89 -0
  100. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/url-alphabet/index.cjs +4 -0
  101. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/url-alphabet/index.js +4 -0
  102. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/nanoid/url-alphabet/package.json +6 -0
  103. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/picocolors/LICENSE +15 -0
  104. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/picocolors/README.md +21 -0
  105. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/picocolors/package.json +25 -0
  106. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/picocolors/picocolors.browser.js +4 -0
  107. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/picocolors/picocolors.js +75 -0
  108. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/LICENSE +20 -0
  109. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/README.md +25 -0
  110. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/at-rule.js +25 -0
  111. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/comment.js +13 -0
  112. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/container.js +447 -0
  113. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/css-syntax-error.js +133 -0
  114. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/declaration.js +24 -0
  115. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/document.js +33 -0
  116. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/fromJSON.js +68 -0
  117. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/input.js +276 -0
  118. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/lazy-result.js +563 -0
  119. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/list.js +58 -0
  120. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/map-generator.js +376 -0
  121. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/no-work-result.js +137 -0
  122. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/node.js +456 -0
  123. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/parse.js +42 -0
  124. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/parser.js +618 -0
  125. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/postcss.d.mts +66 -0
  126. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/postcss.js +101 -0
  127. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/postcss.mjs +30 -0
  128. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/previous-map.js +161 -0
  129. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/processor.js +67 -0
  130. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/result.js +42 -0
  131. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/root.js +61 -0
  132. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/rule.js +27 -0
  133. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/stringifier.js +374 -0
  134. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/stringify.js +11 -0
  135. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/symbols.js +5 -0
  136. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/terminal-highlight.js +70 -0
  137. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/tokenize.js +270 -0
  138. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/warn-once.js +13 -0
  139. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/lib/warning.js +37 -0
  140. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/postcss/package.json +88 -0
  141. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/LICENSE +28 -0
  142. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/README.md +765 -0
  143. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/array-set.js +121 -0
  144. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/base64-vlq.js +140 -0
  145. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/base64.js +67 -0
  146. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/binary-search.js +111 -0
  147. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/mapping-list.js +79 -0
  148. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/quick-sort.js +132 -0
  149. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/source-map-consumer.js +1188 -0
  150. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/source-map-generator.js +444 -0
  151. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/source-node.js +413 -0
  152. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/lib/util.js +594 -0
  153. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/package.json +71 -0
  154. package/dist/sandbox-actions/hyperframes-render/bundle/runtime-modules/source-map-js/source-map.js +8 -0
  155. package/dist/xpert-motion-assistant.yaml +240 -37
  156. package/package.json +17 -9
  157. package/skills/motion-agent-skill/SKILL.md +19 -7
@@ -0,0 +1,276 @@
1
+ 'use strict'
2
+
3
+ let { nanoid } = require('nanoid/non-secure')
4
+ let { isAbsolute, resolve } = require('path')
5
+ let { SourceMapConsumer, SourceMapGenerator } = require('source-map-js')
6
+ let { fileURLToPath, pathToFileURL } = require('url')
7
+
8
+ let CssSyntaxError = require('./css-syntax-error')
9
+ let PreviousMap = require('./previous-map')
10
+ let terminalHighlight = require('./terminal-highlight')
11
+
12
+ let lineToIndexCache = Symbol('lineToIndexCache')
13
+
14
+ let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator)
15
+ let pathAvailable = Boolean(resolve && isAbsolute)
16
+
17
+ function getLineToIndex(input) {
18
+ if (input[lineToIndexCache]) return input[lineToIndexCache]
19
+ let lines = input.css.split('\n')
20
+ let lineToIndex = new Array(lines.length)
21
+ let prevIndex = 0
22
+
23
+ for (let i = 0, l = lines.length; i < l; i++) {
24
+ lineToIndex[i] = prevIndex
25
+ prevIndex += lines[i].length + 1
26
+ }
27
+
28
+ input[lineToIndexCache] = lineToIndex
29
+ return lineToIndex
30
+ }
31
+
32
+ class Input {
33
+ get from() {
34
+ return this.file || this.id
35
+ }
36
+
37
+ constructor(css, opts = {}) {
38
+ if (
39
+ css === null ||
40
+ typeof css === 'undefined' ||
41
+ (typeof css === 'object' && !css.toString)
42
+ ) {
43
+ throw new Error(`PostCSS received ${css} instead of CSS string`)
44
+ }
45
+
46
+ this.css = css.toString()
47
+
48
+ if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
49
+ this.hasBOM = true
50
+ this.css = this.css.slice(1)
51
+ } else {
52
+ this.hasBOM = false
53
+ }
54
+
55
+ this.document = this.css
56
+ if (opts.document) this.document = opts.document.toString()
57
+
58
+ if (opts.from) {
59
+ if (
60
+ !pathAvailable ||
61
+ /^\w+:\/\//.test(opts.from) ||
62
+ isAbsolute(opts.from)
63
+ ) {
64
+ this.file = opts.from
65
+ } else {
66
+ this.file = resolve(opts.from)
67
+ }
68
+ }
69
+
70
+ if (pathAvailable && sourceMapAvailable) {
71
+ let map = new PreviousMap(this.css, opts)
72
+ if (map.text) {
73
+ this.map = map
74
+ let file = map.consumer().file
75
+ if (!this.file && file) this.file = this.mapResolve(file)
76
+ }
77
+ }
78
+
79
+ if (!this.file) {
80
+ this.id = '<input css ' + nanoid(6) + '>'
81
+ }
82
+ if (this.map) this.map.file = this.from
83
+ }
84
+
85
+ error(message, line, column, opts = {}) {
86
+ let endColumn, endLine, endOffset, offset, result
87
+
88
+ if (line && typeof line === 'object') {
89
+ let start = line
90
+ let end = column
91
+ if (typeof start.offset === 'number') {
92
+ offset = start.offset
93
+ let pos = this.fromOffset(offset)
94
+ line = pos.line
95
+ column = pos.col
96
+ } else {
97
+ line = start.line
98
+ column = start.column
99
+ offset = this.fromLineAndColumn(line, column)
100
+ }
101
+ if (typeof end.offset === 'number') {
102
+ endOffset = end.offset
103
+ let pos = this.fromOffset(endOffset)
104
+ endLine = pos.line
105
+ endColumn = pos.col
106
+ } else {
107
+ endLine = end.line
108
+ endColumn = end.column
109
+ endOffset = this.fromLineAndColumn(end.line, end.column)
110
+ }
111
+ } else if (!column) {
112
+ offset = line
113
+ let pos = this.fromOffset(offset)
114
+ line = pos.line
115
+ column = pos.col
116
+ } else {
117
+ offset = this.fromLineAndColumn(line, column)
118
+ }
119
+
120
+ let origin = this.origin(line, column, endLine, endColumn)
121
+ if (origin) {
122
+ result = new CssSyntaxError(
123
+ message,
124
+ origin.endLine === undefined
125
+ ? origin.line
126
+ : { column: origin.column, line: origin.line },
127
+ origin.endLine === undefined
128
+ ? origin.column
129
+ : { column: origin.endColumn, line: origin.endLine },
130
+ origin.source,
131
+ origin.file,
132
+ opts.plugin
133
+ )
134
+ } else {
135
+ result = new CssSyntaxError(
136
+ message,
137
+ endLine === undefined ? line : { column, line },
138
+ endLine === undefined ? column : { column: endColumn, line: endLine },
139
+ this.css,
140
+ this.file,
141
+ opts.plugin
142
+ )
143
+ }
144
+
145
+ result.input = {
146
+ column,
147
+ endColumn,
148
+ endLine,
149
+ endOffset,
150
+ line,
151
+ offset,
152
+ source: this.css
153
+ }
154
+ if (this.file) {
155
+ if (pathToFileURL) {
156
+ result.input.url = pathToFileURL(this.file).toString()
157
+ }
158
+ result.input.file = this.file
159
+ }
160
+
161
+ return result
162
+ }
163
+
164
+ fromLineAndColumn(line, column) {
165
+ let lineToIndex = getLineToIndex(this)
166
+ let index = lineToIndex[line - 1]
167
+ return index + column - 1
168
+ }
169
+
170
+ fromOffset(offset) {
171
+ let lineToIndex = getLineToIndex(this)
172
+ let lastLine = lineToIndex[lineToIndex.length - 1]
173
+
174
+ let min = 0
175
+ if (offset >= lastLine) {
176
+ min = lineToIndex.length - 1
177
+ } else {
178
+ let max = lineToIndex.length - 2
179
+ let mid
180
+ while (min < max) {
181
+ mid = min + ((max - min) >> 1)
182
+ if (offset < lineToIndex[mid]) {
183
+ max = mid - 1
184
+ } else if (offset >= lineToIndex[mid + 1]) {
185
+ min = mid + 1
186
+ } else {
187
+ min = mid
188
+ break
189
+ }
190
+ }
191
+ }
192
+ return {
193
+ col: offset - lineToIndex[min] + 1,
194
+ line: min + 1
195
+ }
196
+ }
197
+
198
+ mapResolve(file) {
199
+ if (/^\w+:\/\//.test(file)) {
200
+ return file
201
+ }
202
+ return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file)
203
+ }
204
+
205
+ origin(line, column, endLine, endColumn) {
206
+ if (!this.map) return false
207
+ let consumer = this.map.consumer()
208
+
209
+ let from = consumer.originalPositionFor({ column: column - 1, line })
210
+ if (!from.source) return false
211
+
212
+ let to
213
+ if (typeof endLine === 'number') {
214
+ to = consumer.originalPositionFor({
215
+ column: endColumn - 1,
216
+ line: endLine
217
+ })
218
+ }
219
+
220
+ let fromUrl
221
+
222
+ if (isAbsolute(from.source)) {
223
+ fromUrl = pathToFileURL(from.source)
224
+ } else {
225
+ fromUrl = new URL(
226
+ from.source,
227
+ this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile)
228
+ )
229
+ }
230
+
231
+ let result = {
232
+ column: from.column + 1,
233
+ endColumn: to && to.column + 1,
234
+ endLine: to && to.line,
235
+ line: from.line,
236
+ url: fromUrl.toString()
237
+ }
238
+
239
+ if (fromUrl.protocol === 'file:') {
240
+ if (fileURLToPath) {
241
+ result.file = fileURLToPath(fromUrl)
242
+ } else {
243
+ /* c8 ignore next 2 */
244
+ throw new Error(`file: protocol is not available in this PostCSS build`)
245
+ }
246
+ }
247
+
248
+ let source = consumer.sourceContentFor(from.source)
249
+ if (source) result.source = source
250
+
251
+ return result
252
+ }
253
+
254
+ toJSON() {
255
+ let json = {}
256
+ for (let name of ['hasBOM', 'css', 'file', 'id']) {
257
+ if (this[name] != null) {
258
+ json[name] = this[name]
259
+ }
260
+ }
261
+ if (this.map) {
262
+ json.map = { ...this.map }
263
+ if (json.map.consumerCache) {
264
+ json.map.consumerCache = undefined
265
+ }
266
+ }
267
+ return json
268
+ }
269
+ }
270
+
271
+ module.exports = Input
272
+ Input.default = Input
273
+
274
+ if (terminalHighlight && terminalHighlight.registerInput) {
275
+ terminalHighlight.registerInput(Input)
276
+ }