@pretextbook/import 0.5.0 → 0.6.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/dist/import.css CHANGED
@@ -1 +1 @@
1
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-800:oklch(44.4% .177 26.899);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-green-700:oklch(52.7% .154 150.069);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-lg:.5rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.h-8{height:calc(var(--spacing) * 8)}.max-h-72{max-height:calc(var(--spacing) * 72)}.w-8{width:calc(var(--spacing) * 8)}.w-full{width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-700{border-color:var(--color-blue-700)}.border-red-200{border-color:var(--color-red-200)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-t-transparent{border-top-color:#0000}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-700{background-color:var(--color-blue-700)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-white{background-color:var(--color-white)}.p-4{padding:calc(var(--spacing) * 4)}.p-10{padding:calc(var(--spacing) * 10)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:var(--spacing)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-green-700{color:var(--color-green-700)}.text-red-800{color:var(--color-red-800)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-slate-400:hover{border-color:var(--color-slate-400)}.hover\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\:text-slate-900:hover{color:var(--color-slate-900)}}.disabled\:opacity-50:disabled{opacity:.5}}select,select option{background-color:var(--color-slate-50,#f8fafc);color:var(--color-slate-900,#0f172a)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}
1
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-outline-style:solid}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-200:oklch(88.5% .062 18.334);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-green-50:oklch(98.2% .018 155.826);--color-green-700:oklch(52.7% .154 150.069);--color-green-900:oklch(39.3% .095 152.535);--color-blue-50:oklch(97% .014 254.604);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-slate-50:oklch(98.4% .003 247.858);--color-slate-100:oklch(96.8% .007 247.896);--color-slate-200:oklch(92.9% .013 255.508);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-slate-600:oklch(44.6% .043 257.281);--color-slate-700:oklch(37.2% .044 257.287);--color-slate-800:oklch(27.9% .041 260.031);--color-slate-900:oklch(20.8% .042 265.755);--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--font-weight-semibold:600;--leading-relaxed:1.625;--radius-lg:.5rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.collapse{visibility:collapse}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-2{margin-left:calc(var(--spacing) * 2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.table{display:table}.h-8{height:calc(var(--spacing) * 8)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-72{max-height:calc(var(--spacing) * 72)}.w-8{width:calc(var(--spacing) * 8)}.w-full{width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-200{border-color:var(--color-amber-200)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-700{border-color:var(--color-blue-700)}.border-red-200{border-color:var(--color-red-200)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-300{border-color:var(--color-slate-300)}.border-t-transparent{border-top-color:#0000}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-700{background-color:var(--color-blue-700)}.bg-green-50{background-color:var(--color-green-50)}.bg-red-50{background-color:var(--color-red-50)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-100{background-color:var(--color-slate-100)}.bg-white{background-color:var(--color-white)}.p-4{padding:calc(var(--spacing) * 4)}.p-10{padding:calc(var(--spacing) * 10)}.px-1{padding-inline:var(--spacing)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-1{padding-top:var(--spacing)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-green-700{color:var(--color-green-700)}.text-green-900{color:var(--color-green-900)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.select-none{-webkit-user-select:none;user-select:none}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-slate-400:hover{border-color:var(--color-slate-400)}.hover\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\:bg-slate-50:hover{background-color:var(--color-slate-50)}.hover\:bg-slate-200:hover{background-color:var(--color-slate-200)}.hover\:text-slate-900:hover{color:var(--color-slate-900)}}.disabled\:opacity-50:disabled{opacity:.5}}select,select option{background-color:var(--color-slate-50,#f8fafc);color:var(--color-slate-900,#0f172a)}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@keyframes spin{to{transform:rotate(360deg)}}
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./import-mode-C8xFGO8j.cjs"),S={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",pdf:"application/pdf",eps:"application/postscript",ps:"application/postscript",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",ico:"image/vnd.microsoft.icon"};function v(t){const o=t.split(".").pop()?.toLowerCase()??"";return S[o]??"application/octet-stream"}const f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function M(t){const o=t.length,r=[];for(let n=0;n<o;n+=3){const i=t[n],s=n+1<o,l=n+2<o,c=s?t[n+1]:0,u=l?t[n+2]:0;r.push(f[i>>2]),r.push(f[(i&3)<<4|c>>4]),r.push(s?f[(c&15)<<2|u>>6]:"="),r.push(l?f[u&63]:"=")}return r.join("")}function R(t){return{ref:t.ref,kind:"file",title:t.fileName,short_description:t.fileName,file:{filename:t.fileName,content_type:v(t.fileName),data:M(t.data)}}}function j(t){return{title:t.title,docinfo:t.docinfo,document_type:t.documentKind,divisions_attributes:t.divisions.map(o=>({ref:o.xmlId,source:o.content,source_format:o.sourceFormat,is_root:o.isRoot})),assets_attributes:t.assets.map(R)}}const P={mainSourcePath:"source/main.ptx",publicationPath:"publication/publication.ptx",projectFilePath:"project.ptx",docinfoPath:"source/docinfo.ptx"};function g(t){return e.findAnyElement(t,"pretext")?t:`<pretext>
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./import-mode-Bu7Pi9k4.cjs"),v={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",pdf:"application/pdf",eps:"application/postscript",ps:"application/postscript",bmp:"image/bmp",tiff:"image/tiff",tif:"image/tiff",webp:"image/webp",ico:"image/vnd.microsoft.icon"};function F(t){const i=t.split(".").pop()?.toLowerCase()??"";return v[i]??"application/octet-stream"}const m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function E(t){const i=t.length,a=[];for(let n=0;n<i;n+=3){const o=t[n],s=n+1<i,c=n+2<i,l=s?t[n+1]:0,p=c?t[n+2]:0;a.push(m[o>>2]),a.push(m[(o&3)<<4|l>>4]),a.push(s?m[(l&15)<<2|p>>6]:"="),a.push(c?m[p&63]:"=")}return a.join("")}function _(t){return{ref:t.ref,kind:"file",title:t.fileName,short_description:t.fileName,file:{filename:t.fileName,content_type:F(t.fileName),data:E(t.data)}}}function A(t){return{title:t.title,docinfo:t.docinfo,document_type:t.documentKind,divisions_attributes:t.divisions.map(i=>({ref:i.xmlId,source:i.content,source_format:i.sourceFormat,is_root:i.isRoot})),assets_attributes:t.assets.map(_)}}const P={mainSourcePath:"source/main.ptx",publicationPath:"publication/publication.ptx",projectFilePath:"project.ptx",docinfoPath:"source/docinfo.ptx"};function g(t){return e.findAnyElement(t,"pretext")?t:`<pretext>
2
2
  ${t}
3
- </pretext>`}function h(t,o,r){const n=new Map,i=[],s=`${o}-`;return t.forEach((l,c)=>{const u=l.attributes["xml:id"];let p;if(u){const d=e.slugify(u);p=d.startsWith(s)?d:`${s}${d}`}else p=`${s}${e.padIndex(c+1,t.length)}`,r.push({action:"anomaly",severity:"info",kind:"structure",category:"missing_xml_id",macro:l.name,occurrences:1,message:`<${l.name}> at position ${c+1} has no xml:id; using \`${p}\` as filename.`});const m=n.get(p)??0;n.set(p,m+1);const a=m===0?p:`${p}-${m+1}`;i.push({span:l,slug:a,filename:`${a}.ptx`})}),i}function E(t,o,r,n){const i=e.findTopLevelElements(t,"section");if(i.length===0)return t;const l=h(i,"sec",n).map(c=>{const u=`source/${o}/${c.filename}`;return r[u]=e.withProlog(c.span.outer),{start:c.span.start,end:c.span.end,replacement:`<xi:include href="${o}/${c.filename}"/>`}});return e.spliceReplacements(t,l)}function _(t,o,r){const n=e.findAnyElement(t,"book");if(!n)return r.push({action:"anomaly",severity:"warning",kind:"structure",category:"missing_root",macro:"book",occurrences:1,message:"Document was treated as a book but no <book> element found; emitting as a single file."}),T(t,o);const i={},s=e.findTopLevelElements(n.inner,"chapter");let l=n.inner;if(o.splitChapters&&s.length>0){const m=h(s,"ch",r).map(a=>{let d=a.span.outer;if(o.splitSections){const b=a.span.inner,F=E(b,a.slug,i,r);d=a.span.outer.slice(0,a.span.startTagEnd-a.span.start)+F+a.span.outer.slice(a.span.contentEnd-a.span.start)}const x=`source/${a.filename}`;return i[x]=e.withProlog(d),{start:a.span.start,end:a.span.end,replacement:`<xi:include href="${a.filename}"/>`}});l=e.spliceReplacements(n.inner,m)}const c=t.slice(n.start,n.startTagEnd)+l+t.slice(n.contentEnd,n.end),u=t.slice(0,n.start)+c+t.slice(n.end);return i[o.mainSourcePath]=e.withProlog(e.ensureXIncludeNamespace(g(u.trim()))),i}function T(t,o,r){const n={};return n[o.mainSourcePath]=e.withProlog(g(t.trim())),n}function A(t,o={}){const r=[],n=o.documentKind??e.detectDocumentKind(t),i={splitChapters:o.splitChapters??n==="book",splitSections:o.splitSections??!1,mainSourcePath:o.mainSourcePath??P.mainSourcePath,publicationPath:o.publicationPath??P.publicationPath,projectFilePath:o.projectFilePath??P.projectFilePath,docinfoPath:o.docinfoPath??P.docinfoPath},s=n==="book"?_(t,i,r):T(t,i);return s[i.projectFilePath]=e.renderProjectPtx({mainSource:i.mainSourcePath,publication:i.publicationPath}),s[i.publicationPath]=e.renderPublicationPtx(),{files:s,documentKind:n,warnings:r}}exports.LATEX_FORMAT_MARKERS=e.LATEX_FORMAT_MARKERS;exports.MARKDOWN_FORMAT_MARKERS=e.MARKDOWN_FORMAT_MARKERS;exports.PRETEXT_DIVISION_TAGS=e.PRETEXT_DIVISION_TAGS;exports.PRETEXT_ROOT_TAGS=e.PRETEXT_ROOT_TAGS;exports.analyzeImportSources=e.analyzeImportSources;exports.assetsForImportMode=e.assetsForImportMode;exports.attachLatexRoots=e.attachLatexRoots;exports.attachMarkdownRoots=e.attachMarkdownRoots;exports.buildDivisionPool=e.buildDivisionPool;exports.buildNativeDivisionPool=e.buildNativeDivisionPool;exports.carryOverProjectFiles=e.carryOverProjectFiles;exports.cleanLatex=e.cleanLatex;exports.convertLatexToPretext=e.convertLatexToPretext;exports.convertMarkdownToPretext=e.convertMarkdownToPretext;exports.convertSourceToPretext=e.convertSourceToPretext;exports.defaultAttachLevel=e.defaultAttachLevel;exports.defaultManifestTarget=e.defaultManifestTarget;exports.detectDocumentKind=e.detectDocumentKind;exports.detectSourceFormat=e.detectSourceFormat;exports.divisionChildRefs=e.divisionChildRefs;exports.expandPretextIncludes=e.expandPretextIncludes;exports.extractUpload=e.extractUpload;exports.filePrefixForDivision=e.filePrefixForDivision;exports.filesForImportMode=e.filesForImportMode;exports.findProjectManifest=e.findProjectManifest;exports.formatWarningLine=e.formatWarningLine;exports.getConversionErrorMessage=e.getConversionErrorMessage;exports.handleImportUploadFile=e.handleImportUploadFile;exports.importProjectFromFiles=e.importProjectFromFiles;exports.isDivisionTag=e.isDivisionTag;exports.normalizePretextSource=e.normalizePretextSource;exports.parseProjectManifest=e.parseProjectManifest;exports.projectForImportMode=e.projectForImportMode;exports.renderProjectPtx=e.renderProjectPtx;exports.renderProjectPtxFromManifest=e.renderProjectPtxFromManifest;exports.renderPublicationPtx=e.renderPublicationPtx;exports.resolveSplitLevel=e.resolveSplitLevel;exports.sanitizeRef=e.sanitizeRef;exports.serializeProjectToFiles=e.serializeProjectToFiles;exports.buildPretextProjectFiles=A;exports.serializeProjectToPlusPayload=j;
3
+ </pretext>`}function x(t,i,a){const n=new Map,o=[],s=`${i}-`;return t.forEach((c,l)=>{const p=c.attributes["xml:id"];let u;if(p){const d=e.slugify(p);u=d.startsWith(s)?d:`${s}${d}`}else u=`${s}${e.padIndex(l+1,t.length)}`,a.push({action:"anomaly",severity:"info",kind:"structure",category:"missing_xml_id",macro:c.name,occurrences:1,message:`<${c.name}> at position ${l+1} has no xml:id; using \`${u}\` as filename.`});const f=n.get(u)??0;n.set(u,f+1);const r=f===0?u:`${u}-${f+1}`;o.push({span:c,slug:r,filename:`${r}.ptx`})}),o}function b(t,i,a,n){const o=e.findTopLevelElements(t,"section");if(o.length===0)return t;const c=x(o,"sec",n).map(l=>{const p=`source/${i}/${l.filename}`;return a[p]=e.withProlog(l.span.outer),{start:l.span.start,end:l.span.end,replacement:`<xi:include href="${i}/${l.filename}"/>`}});return e.spliceReplacements(t,c)}function I(t,i,a){const n=e.findAnyElement(t,"book");if(!n)return a.push({action:"anomaly",severity:"warning",kind:"structure",category:"missing_root",macro:"book",occurrences:1,message:"Document was treated as a book but no <book> element found; emitting as a single file."}),h(t,i);const o={},s=e.findTopLevelElements(n.inner,"chapter");let c=n.inner;if(i.splitChapters&&s.length>0){const f=x(s,"ch",a).map(r=>{let d=r.span.outer;if(i.splitSections){const L=r.span.inner,S=b(L,r.slug,o,a);d=r.span.outer.slice(0,r.span.startTagEnd-r.span.start)+S+r.span.outer.slice(r.span.contentEnd-r.span.start)}const T=`source/${r.filename}`;return o[T]=e.withProlog(d),{start:r.span.start,end:r.span.end,replacement:`<xi:include href="${r.filename}"/>`}});c=e.spliceReplacements(n.inner,f)}const l=t.slice(n.start,n.startTagEnd)+c+t.slice(n.contentEnd,n.end),p=t.slice(0,n.start)+l+t.slice(n.end);return o[i.mainSourcePath]=e.withProlog(e.ensureXIncludeNamespace(g(p.trim()))),o}function h(t,i,a){const n={};return n[i.mainSourcePath]=e.withProlog(g(t.trim())),n}function M(t,i={}){const a=[],n=i.documentKind??e.detectDocumentKind(t),o={splitChapters:i.splitChapters??n==="book",splitSections:i.splitSections??!1,mainSourcePath:i.mainSourcePath??P.mainSourcePath,publicationPath:i.publicationPath??P.publicationPath,projectFilePath:i.projectFilePath??P.projectFilePath,docinfoPath:i.docinfoPath??P.docinfoPath},s=n==="book"?I(t,o,a):h(t,o);return s[o.projectFilePath]=e.renderProjectPtx({mainSource:o.mainSourcePath,publication:o.publicationPath}),s[o.publicationPath]=e.renderPublicationPtx(),{files:s,documentKind:n,warnings:a}}exports.CLEAN_RULES=e.CLEAN_RULES;exports.LATEX_DIVISION_COMMANDS=e.LATEX_DIVISION_COMMANDS;exports.LATEX_FORMAT_MARKERS=e.LATEX_FORMAT_MARKERS;exports.MARKDOWN_FORMAT_MARKERS=e.MARKDOWN_FORMAT_MARKERS;exports.MAX_SUGGESTED_SPLIT_LEVEL=e.MAX_SUGGESTED_SPLIT_LEVEL;exports.PRETEXT_DIVISION_TAGS=e.PRETEXT_DIVISION_TAGS;exports.PRETEXT_ROOT_TAGS=e.PRETEXT_ROOT_TAGS;exports.analyzeImportSources=e.analyzeImportSources;exports.applyLatexFixes=e.applyLatexFixes;exports.assetsForImportMode=e.assetsForImportMode;exports.attachLatexRoots=e.attachLatexRoots;exports.attachMarkdownRoots=e.attachMarkdownRoots;exports.buildDivisionPool=e.buildDivisionPool;exports.buildNativeDivisionPool=e.buildNativeDivisionPool;exports.carryOverProjectFiles=e.carryOverProjectFiles;exports.cleanLatex=e.cleanLatex;exports.cleanLatexInChunks=e.cleanLatexInChunks;exports.cleanLatexText=e.cleanLatexText;exports.convertLatexToPretext=e.convertLatexToPretext;exports.convertMarkdownToPretext=e.convertMarkdownToPretext;exports.convertSourceToPretext=e.convertSourceToPretext;exports.defaultAttachLevel=e.defaultAttachLevel;exports.defaultManifestTarget=e.defaultManifestTarget;exports.detectDocumentKind=e.detectDocumentKind;exports.detectSourceFormat=e.detectSourceFormat;exports.diffHunks=e.diffHunks;exports.diffLines=e.diffLines;exports.diffStats=e.diffStats;exports.divisionChildRefs=e.divisionChildRefs;exports.divisionsAtLevel=e.divisionsAtLevel;exports.expandPretextIncludes=e.expandPretextIncludes;exports.extractUpload=e.extractUpload;exports.fileChangesForImport=e.fileChangesForImport;exports.filePrefixForDivision=e.filePrefixForDivision;exports.filesForImportMode=e.filesForImportMode;exports.findLatexFixes=e.findLatexFixes;exports.findLatexHeaders=e.findLatexHeaders;exports.findProjectManifest=e.findProjectManifest;exports.fixesToWarnings=e.fixesToWarnings;exports.formatWarningLine=e.formatWarningLine;exports.getConversionErrorMessage=e.getConversionErrorMessage;exports.getLatexCleanDiagnostics=e.getLatexCleanDiagnostics;exports.handleImportUploadFile=e.handleImportUploadFile;exports.importProjectFromFiles=e.importProjectFromFiles;exports.isDivisionTag=e.isDivisionTag;exports.latexDivisionHierarchy=e.latexDivisionHierarchy;exports.latexFixesToCodeActions=e.latexFixesToCodeActions;exports.mergeChunksAtLevel=e.mergeChunksAtLevel;exports.normalizePretextSource=e.normalizePretextSource;exports.parseLatexDivisions=e.parseLatexDivisions;exports.parseProjectManifest=e.parseProjectManifest;exports.projectForImportMode=e.projectForImportMode;exports.relayoutImport=e.relayoutImport;exports.renderProjectPtx=e.renderProjectPtx;exports.renderProjectPtxFromManifest=e.renderProjectPtxFromManifest;exports.renderPublicationPtx=e.renderPublicationPtx;exports.resolveImportSplitLevel=e.resolveImportSplitLevel;exports.resolveSplitLevel=e.resolveSplitLevel;exports.sanitizeRef=e.sanitizeRef;exports.serializeProjectToFiles=e.serializeProjectToFiles;exports.suggestSplitLevel=e.suggestSplitLevel;exports.buildPretextProjectFiles=M;exports.serializeProjectToPlusPayload=A;
package/dist/index.d.ts CHANGED
@@ -1,15 +1,21 @@
1
1
  export { detectSourceFormat, LATEX_FORMAT_MARKERS, MARKDOWN_FORMAT_MARKERS, } from './lib/detect-source-format';
2
2
  export { convertLatexToPretext, convertMarkdownToPretext, normalizePretextSource, convertSourceToPretext, getConversionErrorMessage, } from './lib/convert';
3
3
  export type { LatexConversionResult, MarkdownConversionResult, } from './lib/convert';
4
- export { importProjectFromFiles, handleImportUploadFile, extractUpload, type ExtractedUpload, type ImportProjectOptions, } from './lib/upload';
4
+ export { importProjectFromFiles, handleImportUploadFile, extractUpload, relayoutImport, resolveImportSplitLevel, type ExtractedUpload, type ImportProjectOptions, type SplitLevelContext, } from './lib/upload';
5
+ export { LATEX_DIVISION_COMMANDS, findLatexHeaders, latexDivisionHierarchy, parseLatexDivisions, divisionsAtLevel, suggestSplitLevel, MAX_SUGGESTED_SPLIT_LEVEL, type LatexDivision, type LatexDivisionCommand, } from './lib/latex-split';
6
+ export { fileChangesForImport, type FileChangeRecord, } from './lib/file-changes';
7
+ export { diffLines, diffHunks, diffStats, type DiffLine, type DiffHunk, type DiffStats, } from './lib/diff';
8
+ export { cleanLatexInChunks, mergeChunksAtLevel, type CleanedChunk, type CleanLatexChunksResult, } from './lib/clean/clean-chunks';
5
9
  export { analyzeImportSources, type AnalyzeOptions, type RootCandidate, type RootReason, type UploadAnalysis, } from './lib/project/analyze';
6
10
  export { attachLatexRoots, attachMarkdownRoots, defaultAttachLevel, type AttachLevel, type AttachedRootRecord, type AttachRootsResult, type RootAttachment, } from './lib/project/attach-roots';
7
11
  export { defaultManifestTarget, findProjectManifest, parseProjectManifest, type ManifestTarget, type ProjectManifest, } from './lib/project/manifest';
8
12
  export { carryOverProjectFiles, renderProjectPtxFromManifest, type CarryOverOptions, type CarryOverResult, } from './lib/project/existing-project';
9
13
  export { PRETEXT_DIVISION_TAGS, PRETEXT_ROOT_TAGS, filePrefixForDivision, isDivisionTag, type PretextDivisionTag, type PretextRootTag, } from './lib/pretext-divisions';
10
14
  export { filesForImportMode, assetsForImportMode, projectForImportMode, formatWarningLine, type ImportMode, } from './lib/import-mode';
11
- export { cleanLatex } from './lib/clean/clean-latex';
12
- export type { CleanLatexResult } from './lib/clean/clean-latex';
15
+ export { cleanLatex, fixesToWarnings } from './lib/clean/clean-latex';
16
+ export type { CleanLatexOptions, CleanLatexResult, } from './lib/clean/clean-latex';
17
+ export { CLEAN_RULES, findLatexFixes, applyLatexFixes, cleanLatexText, getLatexCleanDiagnostics, latexFixesToCodeActions, } from '@pretextbook/latex-style-pretext';
18
+ export type { CleanRule, CleanScope, FindFixesOptions, LatexFix, } from '@pretextbook/latex-style-pretext';
13
19
  export { expandPretextIncludes } from './lib/clean/pretext-includes';
14
20
  export type { CleaningWarning, CleaningSeverity, CleaningAction, } from './lib/clean/warnings';
15
21
  export { buildPretextProjectFiles, detectDocumentKind, renderProjectPtx, renderPublicationPtx, } from './lib/layout';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { d as j, r as v, a as R, f as g, b as h, w as P, s as b, e as A, c as M, p as $ } from "./import-mode-Dc8qmZP6.js";
2
- import { L as B, M as W, P as X, g as G, h as U, i as H, j as q, k as J, l as Q, m as V, n as Y, o as Z, q as tt, t as et, u as nt, v as at, x as st, y as ot, z as it, A as rt, B as ct, C as lt, D as pt, E as ut, F as mt, G as ft, H as dt, I as Pt, J as gt, K as ht, N as bt, O as xt, Q as Tt, R as Ft, S as St, T as Et } from "./import-mode-Dc8qmZP6.js";
3
- const k = {
1
+ import { d as _, r as v, a as A, f as g, b as h, w as P, s as x, e as I, c as C, p as j } from "./import-mode-C0KIll3S.js";
2
+ import { C as B, L as X, g as U, M as W, h as G, P as H, i as V, j as Y, k as q, l as J, m as Q, n as Z, o as ee, q as te, t as ae, u as se, v as ne, x as ie, y as oe, z as re, A as ce, B as le, D as pe, E as ue, F as fe, G as me, H as de, I as Pe, J as ge, K as he, N as xe, O as be, Q as Se, R as Te, S as Ee, T as Fe, U as Le, V as _e, W as ve, X as Ae, Y as Ie, Z as Ce, _ as je, $ as Me, a0 as Re, a1 as ke, a2 as $e, a3 as De, a4 as ye, a5 as we, a6 as Ne, a7 as Oe, a8 as Ke, a9 as ze, aa as Be, ab as Xe, ac as Ue, ad as We } from "./import-mode-C0KIll3S.js";
3
+ const M = {
4
4
  png: "image/png",
5
5
  jpg: "image/jpeg",
6
6
  jpeg: "image/jpeg",
@@ -14,44 +14,44 @@ const k = {
14
14
  webp: "image/webp",
15
15
  ico: "image/vnd.microsoft.icon"
16
16
  };
17
- function I(t) {
18
- const e = t.split(".").pop()?.toLowerCase() ?? "";
19
- return k[e] ?? "application/octet-stream";
17
+ function R(e) {
18
+ const t = e.split(".").pop()?.toLowerCase() ?? "";
19
+ return M[t] ?? "application/octet-stream";
20
20
  }
21
- const f = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
22
- function w(t) {
23
- const e = t.length, s = [];
24
- for (let n = 0; n < e; n += 3) {
25
- const a = t[n], i = n + 1 < e, c = n + 2 < e, r = i ? t[n + 1] : 0, l = c ? t[n + 2] : 0;
26
- s.push(f[a >> 2]), s.push(f[(a & 3) << 4 | r >> 4]), s.push(i ? f[(r & 15) << 2 | l >> 6] : "="), s.push(c ? f[l & 63] : "=");
21
+ const m = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
22
+ function k(e) {
23
+ const t = e.length, n = [];
24
+ for (let a = 0; a < t; a += 3) {
25
+ const s = e[a], o = a + 1 < t, c = a + 2 < t, r = o ? e[a + 1] : 0, l = c ? e[a + 2] : 0;
26
+ n.push(m[s >> 2]), n.push(m[(s & 3) << 4 | r >> 4]), n.push(o ? m[(r & 15) << 2 | l >> 6] : "="), n.push(c ? m[l & 63] : "=");
27
27
  }
28
- return s.join("");
28
+ return n.join("");
29
29
  }
30
- function C(t) {
30
+ function $(e) {
31
31
  return {
32
- ref: t.ref,
32
+ ref: e.ref,
33
33
  kind: "file",
34
- title: t.fileName,
35
- short_description: t.fileName,
34
+ title: e.fileName,
35
+ short_description: e.fileName,
36
36
  file: {
37
- filename: t.fileName,
38
- content_type: I(t.fileName),
39
- data: w(t.data)
37
+ filename: e.fileName,
38
+ content_type: R(e.fileName),
39
+ data: k(e.data)
40
40
  }
41
41
  };
42
42
  }
43
- function N(t) {
43
+ function N(e) {
44
44
  return {
45
- title: t.title,
46
- docinfo: t.docinfo,
47
- document_type: t.documentKind,
48
- divisions_attributes: t.divisions.map((e) => ({
49
- ref: e.xmlId,
50
- source: e.content,
51
- source_format: e.sourceFormat,
52
- is_root: e.isRoot
45
+ title: e.title,
46
+ docinfo: e.docinfo,
47
+ document_type: e.documentKind,
48
+ divisions_attributes: e.divisions.map((t) => ({
49
+ ref: t.xmlId,
50
+ source: t.content,
51
+ source_format: t.sourceFormat,
52
+ is_root: t.isRoot
53
53
  })),
54
- assets_attributes: t.assets.map(C)
54
+ assets_attributes: e.assets.map($)
55
55
  };
56
56
  }
57
57
  const d = {
@@ -60,21 +60,21 @@ const d = {
60
60
  projectFilePath: "project.ptx",
61
61
  docinfoPath: "source/docinfo.ptx"
62
62
  };
63
- function x(t) {
64
- return g(t, "pretext") ? t : `<pretext>
65
- ${t}
63
+ function b(e) {
64
+ return g(e, "pretext") ? e : `<pretext>
65
+ ${e}
66
66
  </pretext>`;
67
67
  }
68
- function T(t, e, s) {
69
- const n = /* @__PURE__ */ new Map(), a = [], i = `${e}-`;
70
- return t.forEach((c, r) => {
68
+ function S(e, t, n) {
69
+ const a = /* @__PURE__ */ new Map(), s = [], o = `${t}-`;
70
+ return e.forEach((c, r) => {
71
71
  const l = c.attributes["xml:id"];
72
72
  let p;
73
73
  if (l) {
74
- const u = M(l);
75
- p = u.startsWith(i) ? u : `${i}${u}`;
74
+ const u = C(l);
75
+ p = u.startsWith(o) ? u : `${o}${u}`;
76
76
  } else
77
- p = `${i}${$(r + 1, t.length)}`, s.push({
77
+ p = `${o}${j(r + 1, e.length)}`, n.push({
78
78
  action: "anomaly",
79
79
  severity: "info",
80
80
  kind: "structure",
@@ -83,34 +83,34 @@ function T(t, e, s) {
83
83
  occurrences: 1,
84
84
  message: `<${c.name}> at position ${r + 1} has no xml:id; using \`${p}\` as filename.`
85
85
  });
86
- const m = n.get(p) ?? 0;
87
- n.set(p, m + 1);
88
- const o = m === 0 ? p : `${p}-${m + 1}`;
89
- a.push({
86
+ const f = a.get(p) ?? 0;
87
+ a.set(p, f + 1);
88
+ const i = f === 0 ? p : `${p}-${f + 1}`;
89
+ s.push({
90
90
  span: c,
91
- slug: o,
92
- filename: `${o}.ptx`
91
+ slug: i,
92
+ filename: `${i}.ptx`
93
93
  });
94
- }), a;
94
+ }), s;
95
95
  }
96
- function y(t, e, s, n) {
97
- const a = h(t, "section");
98
- if (a.length === 0)
99
- return t;
100
- const c = T(a, "sec", n).map((r) => {
101
- const l = `source/${e}/${r.filename}`;
102
- return s[l] = P(r.span.outer), {
96
+ function D(e, t, n, a) {
97
+ const s = h(e, "section");
98
+ if (s.length === 0)
99
+ return e;
100
+ const c = S(s, "sec", a).map((r) => {
101
+ const l = `source/${t}/${r.filename}`;
102
+ return n[l] = P(r.span.outer), {
103
103
  start: r.span.start,
104
104
  end: r.span.end,
105
- replacement: `<xi:include href="${e}/${r.filename}"/>`
105
+ replacement: `<xi:include href="${t}/${r.filename}"/>`
106
106
  };
107
107
  });
108
- return b(t, c);
108
+ return x(e, c);
109
109
  }
110
- function D(t, e, s) {
111
- const n = g(t, "book");
112
- if (!n)
113
- return s.push({
110
+ function y(e, t, n) {
111
+ const a = g(e, "book");
112
+ if (!a)
113
+ return n.push({
114
114
  action: "anomaly",
115
115
  severity: "warning",
116
116
  kind: "structure",
@@ -118,95 +118,117 @@ function D(t, e, s) {
118
118
  macro: "book",
119
119
  occurrences: 1,
120
120
  message: "Document was treated as a book but no <book> element found; emitting as a single file."
121
- }), F(t, e);
122
- const a = {}, i = h(n.inner, "chapter");
123
- let c = n.inner;
124
- if (e.splitChapters && i.length > 0) {
125
- const m = T(i, "ch", s).map((o) => {
126
- let u = o.span.outer;
127
- if (e.splitSections) {
128
- const E = o.span.inner, _ = y(
129
- E,
130
- o.slug,
131
- a,
132
- s
121
+ }), T(e, t);
122
+ const s = {}, o = h(a.inner, "chapter");
123
+ let c = a.inner;
124
+ if (t.splitChapters && o.length > 0) {
125
+ const f = S(o, "ch", n).map((i) => {
126
+ let u = i.span.outer;
127
+ if (t.splitSections) {
128
+ const F = i.span.inner, L = D(
129
+ F,
130
+ i.slug,
131
+ s,
132
+ n
133
133
  );
134
- u = o.span.outer.slice(0, o.span.startTagEnd - o.span.start) + _ + o.span.outer.slice(o.span.contentEnd - o.span.start);
134
+ u = i.span.outer.slice(0, i.span.startTagEnd - i.span.start) + L + i.span.outer.slice(i.span.contentEnd - i.span.start);
135
135
  }
136
- const S = `source/${o.filename}`;
137
- return a[S] = P(u), {
138
- start: o.span.start,
139
- end: o.span.end,
140
- replacement: `<xi:include href="${o.filename}"/>`
136
+ const E = `source/${i.filename}`;
137
+ return s[E] = P(u), {
138
+ start: i.span.start,
139
+ end: i.span.end,
140
+ replacement: `<xi:include href="${i.filename}"/>`
141
141
  };
142
142
  });
143
- c = b(n.inner, m);
143
+ c = x(a.inner, f);
144
144
  }
145
- const r = t.slice(n.start, n.startTagEnd) + c + t.slice(n.contentEnd, n.end), l = t.slice(0, n.start) + r + t.slice(n.end);
146
- return a[e.mainSourcePath] = P(
147
- A(x(l.trim()))
148
- ), a;
145
+ const r = e.slice(a.start, a.startTagEnd) + c + e.slice(a.contentEnd, a.end), l = e.slice(0, a.start) + r + e.slice(a.end);
146
+ return s[t.mainSourcePath] = P(
147
+ I(b(l.trim()))
148
+ ), s;
149
149
  }
150
- function F(t, e, s) {
151
- const n = {};
152
- return n[e.mainSourcePath] = P(
153
- x(t.trim())
154
- ), n;
150
+ function T(e, t, n) {
151
+ const a = {};
152
+ return a[t.mainSourcePath] = P(
153
+ b(e.trim())
154
+ ), a;
155
155
  }
156
- function O(t, e = {}) {
157
- const s = [], n = e.documentKind ?? j(t), a = {
158
- splitChapters: e.splitChapters ?? n === "book",
159
- splitSections: e.splitSections ?? !1,
160
- mainSourcePath: e.mainSourcePath ?? d.mainSourcePath,
161
- publicationPath: e.publicationPath ?? d.publicationPath,
162
- projectFilePath: e.projectFilePath ?? d.projectFilePath,
163
- docinfoPath: e.docinfoPath ?? d.docinfoPath
164
- }, i = n === "book" ? D(t, a, s) : F(t, a);
165
- return i[a.projectFilePath] = v({
166
- mainSource: a.mainSourcePath,
167
- publication: a.publicationPath
168
- }), i[a.publicationPath] = R(), { files: i, documentKind: n, warnings: s };
156
+ function O(e, t = {}) {
157
+ const n = [], a = t.documentKind ?? _(e), s = {
158
+ splitChapters: t.splitChapters ?? a === "book",
159
+ splitSections: t.splitSections ?? !1,
160
+ mainSourcePath: t.mainSourcePath ?? d.mainSourcePath,
161
+ publicationPath: t.publicationPath ?? d.publicationPath,
162
+ projectFilePath: t.projectFilePath ?? d.projectFilePath,
163
+ docinfoPath: t.docinfoPath ?? d.docinfoPath
164
+ }, o = a === "book" ? y(e, s, n) : T(e, s);
165
+ return o[s.projectFilePath] = v({
166
+ mainSource: s.mainSourcePath,
167
+ publication: s.publicationPath
168
+ }), o[s.publicationPath] = A(), { files: o, documentKind: a, warnings: n };
169
169
  }
170
170
  export {
171
- B as LATEX_FORMAT_MARKERS,
171
+ B as CLEAN_RULES,
172
+ X as LATEX_DIVISION_COMMANDS,
173
+ U as LATEX_FORMAT_MARKERS,
172
174
  W as MARKDOWN_FORMAT_MARKERS,
173
- X as PRETEXT_DIVISION_TAGS,
174
- G as PRETEXT_ROOT_TAGS,
175
- U as analyzeImportSources,
176
- H as assetsForImportMode,
177
- q as attachLatexRoots,
178
- J as attachMarkdownRoots,
179
- Q as buildDivisionPool,
180
- V as buildNativeDivisionPool,
175
+ G as MAX_SUGGESTED_SPLIT_LEVEL,
176
+ H as PRETEXT_DIVISION_TAGS,
177
+ V as PRETEXT_ROOT_TAGS,
178
+ Y as analyzeImportSources,
179
+ q as applyLatexFixes,
180
+ J as assetsForImportMode,
181
+ Q as attachLatexRoots,
182
+ Z as attachMarkdownRoots,
183
+ ee as buildDivisionPool,
184
+ te as buildNativeDivisionPool,
181
185
  O as buildPretextProjectFiles,
182
- Y as carryOverProjectFiles,
183
- Z as cleanLatex,
184
- tt as convertLatexToPretext,
185
- et as convertMarkdownToPretext,
186
- nt as convertSourceToPretext,
187
- at as defaultAttachLevel,
188
- st as defaultManifestTarget,
189
- j as detectDocumentKind,
190
- ot as detectSourceFormat,
191
- it as divisionChildRefs,
192
- rt as expandPretextIncludes,
193
- ct as extractUpload,
194
- lt as filePrefixForDivision,
195
- pt as filesForImportMode,
196
- ut as findProjectManifest,
197
- mt as formatWarningLine,
198
- ft as getConversionErrorMessage,
199
- dt as handleImportUploadFile,
200
- Pt as importProjectFromFiles,
201
- gt as isDivisionTag,
202
- ht as normalizePretextSource,
203
- bt as parseProjectManifest,
204
- xt as projectForImportMode,
186
+ ae as carryOverProjectFiles,
187
+ se as cleanLatex,
188
+ ne as cleanLatexInChunks,
189
+ ie as cleanLatexText,
190
+ oe as convertLatexToPretext,
191
+ re as convertMarkdownToPretext,
192
+ ce as convertSourceToPretext,
193
+ le as defaultAttachLevel,
194
+ pe as defaultManifestTarget,
195
+ _ as detectDocumentKind,
196
+ ue as detectSourceFormat,
197
+ fe as diffHunks,
198
+ me as diffLines,
199
+ de as diffStats,
200
+ Pe as divisionChildRefs,
201
+ ge as divisionsAtLevel,
202
+ he as expandPretextIncludes,
203
+ xe as extractUpload,
204
+ be as fileChangesForImport,
205
+ Se as filePrefixForDivision,
206
+ Te as filesForImportMode,
207
+ Ee as findLatexFixes,
208
+ Fe as findLatexHeaders,
209
+ Le as findProjectManifest,
210
+ _e as fixesToWarnings,
211
+ ve as formatWarningLine,
212
+ Ae as getConversionErrorMessage,
213
+ Ie as getLatexCleanDiagnostics,
214
+ Ce as handleImportUploadFile,
215
+ je as importProjectFromFiles,
216
+ Me as isDivisionTag,
217
+ Re as latexDivisionHierarchy,
218
+ ke as latexFixesToCodeActions,
219
+ $e as mergeChunksAtLevel,
220
+ De as normalizePretextSource,
221
+ ye as parseLatexDivisions,
222
+ we as parseProjectManifest,
223
+ Ne as projectForImportMode,
224
+ Oe as relayoutImport,
205
225
  v as renderProjectPtx,
206
- Tt as renderProjectPtxFromManifest,
207
- R as renderPublicationPtx,
208
- Ft as resolveSplitLevel,
209
- St as sanitizeRef,
210
- Et as serializeProjectToFiles,
211
- N as serializeProjectToPlusPayload
226
+ Ke as renderProjectPtxFromManifest,
227
+ A as renderPublicationPtx,
228
+ ze as resolveImportSplitLevel,
229
+ Be as resolveSplitLevel,
230
+ Xe as sanitizeRef,
231
+ Ue as serializeProjectToFiles,
232
+ N as serializeProjectToPlusPayload,
233
+ We as suggestSplitLevel
212
234
  };
@@ -0,0 +1,47 @@
1
+ import { LatexFix } from '@pretextbook/latex-style-pretext';
2
+ import { CleaningWarning } from './warnings';
3
+ export interface CleanedChunk {
4
+ /**
5
+ * Heading path from the document root — `["Limits", "One-sided limits"]`.
6
+ * Empty for the preamble and for body text ahead of the first heading.
7
+ */
8
+ path: string[];
9
+ /** The chunk's own heading, or `""` when it has none. */
10
+ title: string;
11
+ /** `"preamble"`, a LaTeX sectioning command, or `null` for the lead-in text. */
12
+ kind: "preamble" | "lead" | "division";
13
+ /** Sectioning command that opened this chunk, when `kind` is `"division"`. */
14
+ command?: string;
15
+ /** Depth in the document's own hierarchy; 0 for preamble and lead-in. */
16
+ level: number;
17
+ before: string;
18
+ after: string;
19
+ fixes: LatexFix[];
20
+ }
21
+ export interface CleanLatexChunksResult {
22
+ /** The cleaned document, chunks rejoined in source order. */
23
+ output: string;
24
+ chunks: CleanedChunk[];
25
+ /** Aggregate over every chunk — the document-level summary. */
26
+ warnings: CleaningWarning[];
27
+ fixes: LatexFix[];
28
+ }
29
+ /**
30
+ * Clean `source`, cutting it at every division header so each piece carries its
31
+ * own before/after text and fix list.
32
+ *
33
+ * Chunks are cut at the *deepest* level the document has, not at a requested
34
+ * split depth. A shallower view is a matter of concatenating consecutive chunks
35
+ * (`mergeChunksAtLevel`), which lets the wizard change split depth without
36
+ * re-cleaning or re-converting anything.
37
+ */
38
+ export declare function cleanLatexInChunks(source: string): CleanLatexChunksResult;
39
+ /**
40
+ * Collapse chunks to the view a given split depth produces: one entry per file
41
+ * that depth would generate, with the chunks below it concatenated in.
42
+ *
43
+ * `level` 0 gives a single entry for the whole body; 1 one per top-level
44
+ * division; and so on. The preamble is always its own entry, since it never
45
+ * becomes a file of its own.
46
+ */
47
+ export declare function mergeChunksAtLevel(chunks: CleanedChunk[], level: number): CleanedChunk[];
@@ -1,6 +1,40 @@
1
+ import { CleanScope, LatexFix } from '@pretextbook/latex-style-pretext';
1
2
  import { CleaningWarning } from './warnings';
3
+ export interface CleanLatexOptions {
4
+ /**
5
+ * What the text is. Defaults to `"auto"`, which detects `\begin{document}`.
6
+ * Per-division cleaning (SPEC §3.8) passes `"body"`.
7
+ */
8
+ scope?: CleanScope;
9
+ /** Rule ids to skip. */
10
+ disable?: string[];
11
+ }
2
12
  export interface CleanLatexResult {
3
13
  output: string;
14
+ /** Aggregate, one row per rule — what the wizard's summary list renders. */
4
15
  warnings: CleaningWarning[];
16
+ /**
17
+ * Positioned fixes, in application order. The before/after diff and any
18
+ * per-file report read these; `warnings` is the rolled-up view of the same
19
+ * data.
20
+ */
21
+ fixes: LatexFix[];
5
22
  }
6
- export declare function cleanLatex(source: string): CleanLatexResult;
23
+ /**
24
+ * Clean a piece of LaTeX: strip comments and trailing junk, then apply every
25
+ * cleaning rule to a fixpoint.
26
+ *
27
+ * `trimJunk` runs first and stays on this side of the boundary deliberately.
28
+ * Deleting every comment is right for an import (they are authoring notes about
29
+ * LaTeX, not content) but wrong for an editor, where the author is looking at
30
+ * their own comments and would not expect a cleanup to eat them.
31
+ */
32
+ export declare function cleanLatex(source: string, options?: CleanLatexOptions): CleanLatexResult;
33
+ /**
34
+ * Roll positioned fixes up into one `CleaningWarning` per rule.
35
+ *
36
+ * A rule with `reportMatch` emits two rows, matching what the cleaner has always
37
+ * produced: a `save` carrying the matched text (so the author can reconstruct
38
+ * what a `\def` meant) and a `delete` recording that it went away.
39
+ */
40
+ export declare function fixesToWarnings(fixes: LatexFix[]): CleaningWarning[];
@@ -1,3 +1,4 @@
1
+ import { CleanedChunk } from './clean/clean-chunks';
1
2
  import { CleaningWarning } from './clean/warnings';
2
3
  import { ConvertedPretextResult, SourceFormat } from './types';
3
4
  export declare function normalizePretextSource(pretextSource: string): string;
@@ -5,6 +6,12 @@ export interface LatexConversionResult {
5
6
  pretext: string;
6
7
  cleanedLatex: string;
7
8
  warnings: CleaningWarning[];
9
+ /**
10
+ * The cleaned source cut at its division headers, each piece carrying its own
11
+ * before/after text. The wizard's per-file diff reads these; see
12
+ * `clean-chunks.ts` for why cleaning is partitioned rather than global.
13
+ */
14
+ cleanChunks: CleanedChunk[];
8
15
  }
9
16
  export declare function convertLatexToPretext(latexSource: string): LatexConversionResult;
10
17
  export interface MarkdownConversionResult {