UNPKG

@restnfeel/agentc-starter-kit

Version:

한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템

268 lines (239 loc) 7.08 kB
import { __exports as documents } from '../../../_virtual/documents.js'; import require$$0 from '../../../_virtual/index-all.js'; var hasRequiredDocuments; function requireDocuments () { if (hasRequiredDocuments) return documents; hasRequiredDocuments = 1; var _ = require$$0; var types = documents.types = { document: "document", paragraph: "paragraph", run: "run", text: "text", tab: "tab", checkbox: "checkbox", hyperlink: "hyperlink", noteReference: "noteReference", image: "image", note: "note", commentReference: "commentReference", comment: "comment", table: "table", tableRow: "tableRow", tableCell: "tableCell", "break": "break", bookmarkStart: "bookmarkStart" }; function Document(children, options) { options = options || {}; return { type: types.document, children: children, notes: options.notes || new Notes({}), comments: options.comments || [] }; } function Paragraph(children, properties) { properties = properties || {}; var indent = properties.indent || {}; return { type: types.paragraph, children: children, styleId: properties.styleId || null, styleName: properties.styleName || null, numbering: properties.numbering || null, alignment: properties.alignment || null, indent: { start: indent.start || null, end: indent.end || null, firstLine: indent.firstLine || null, hanging: indent.hanging || null } }; } function Run(children, properties) { properties = properties || {}; return { type: types.run, children: children, styleId: properties.styleId || null, styleName: properties.styleName || null, isBold: !!properties.isBold, isUnderline: !!properties.isUnderline, isItalic: !!properties.isItalic, isStrikethrough: !!properties.isStrikethrough, isAllCaps: !!properties.isAllCaps, isSmallCaps: !!properties.isSmallCaps, verticalAlignment: properties.verticalAlignment || verticalAlignment.baseline, font: properties.font || null, fontSize: properties.fontSize || null, highlight: properties.highlight || null }; } var verticalAlignment = { baseline: "baseline", superscript: "superscript", subscript: "subscript" }; function Text(value) { return { type: types.text, value: value }; } function Tab() { return { type: types.tab }; } function Checkbox(options) { return { type: types.checkbox, checked: options.checked }; } function Hyperlink(children, options) { return { type: types.hyperlink, children: children, href: options.href, anchor: options.anchor, targetFrame: options.targetFrame }; } function NoteReference(options) { return { type: types.noteReference, noteType: options.noteType, noteId: options.noteId }; } function Notes(notes) { this._notes = _.indexBy(notes, function(note) { return noteKey(note.noteType, note.noteId); }); } Notes.prototype.resolve = function(reference) { return this.findNoteByKey(noteKey(reference.noteType, reference.noteId)); }; Notes.prototype.findNoteByKey = function(key) { return this._notes[key] || null; }; function Note(options) { return { type: types.note, noteType: options.noteType, noteId: options.noteId, body: options.body }; } function commentReference(options) { return { type: types.commentReference, commentId: options.commentId }; } function comment(options) { return { type: types.comment, commentId: options.commentId, body: options.body, authorName: options.authorName, authorInitials: options.authorInitials }; } function noteKey(noteType, id) { return noteType + "-" + id; } function Image(options) { return { type: types.image, // `read` is retained for backwards compatibility, but other read // methods should be preferred. read: function(encoding) { if (encoding) { return options.readImage(encoding); } else { return options.readImage().then(function(arrayBuffer) { return Buffer.from(arrayBuffer); }); } }, readAsArrayBuffer: function() { return options.readImage(); }, readAsBase64String: function() { return options.readImage("base64"); }, readAsBuffer: function() { return options.readImage().then(function(arrayBuffer) { return Buffer.from(arrayBuffer); }); }, altText: options.altText, contentType: options.contentType }; } function Table(children, properties) { properties = properties || {}; return { type: types.table, children: children, styleId: properties.styleId || null, styleName: properties.styleName || null }; } function TableRow(children, options) { options = options || {}; return { type: types.tableRow, children: children, isHeader: options.isHeader || false }; } function TableCell(children, options) { options = options || {}; return { type: types.tableCell, children: children, colSpan: options.colSpan == null ? 1 : options.colSpan, rowSpan: options.rowSpan == null ? 1 : options.rowSpan }; } function Break(breakType) { return { type: types["break"], breakType: breakType }; } function BookmarkStart(options) { return { type: types.bookmarkStart, name: options.name }; } documents.document = documents.Document = Document; documents.paragraph = documents.Paragraph = Paragraph; documents.run = documents.Run = Run; documents.text = documents.Text = Text; documents.tab = documents.Tab = Tab; documents.checkbox = documents.Checkbox = Checkbox; documents.Hyperlink = Hyperlink; documents.noteReference = documents.NoteReference = NoteReference; documents.Notes = Notes; documents.Note = Note; documents.commentReference = commentReference; documents.comment = comment; documents.Image = Image; documents.Table = Table; documents.TableRow = TableRow; documents.TableCell = TableCell; documents.lineBreak = Break("line"); documents.pageBreak = Break("page"); documents.columnBreak = Break("column"); documents.BookmarkStart = BookmarkStart; documents.verticalAlignment = verticalAlignment; return documents; } export { requireDocuments as __require }; //# sourceMappingURL=documents.js.map