-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchunk-3G73N5DB.js
43 lines (38 loc) · 12.7 KB
/
chunk-3G73N5DB.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import{$ as s,Ga as t,Od as b,T as c,U as E,Wb as g,Xd as f,Yb as S,Yd as v,Zb as u,_ as l,ha as p,na as i,oa as e,pa as n,se as h,y as m}from"./chunk-23IW53AA.js";var y=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275cmp=l({type:o,selectors:[["sample-po-code-editor-register-doc"]],standalone:!1,decls:404,vars:0,consts:[[1,"docs-api"],[1,"docs-api-module-import"],[1,"docs-api-class-description"],[1,"docs-api-h3"],[1,"docs-api-class-name"],[1,"doc-code"],["href","https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages"],[1,"docs-api-h5","docs-api-method-header"],[1,"docs-api-properties-table"],[1,"docs-api-properties-header-row"],[1,"docs-api-properties-th"],[1,"docs-api-properties-row"],[1,"docs-api-properties-name-cell"],[1,"docs-api-input-marker"],[1,"docs-api-input-alias"],[1,"docs-api-properties-type-cell"],["pan","",1,"docs-api-property-type","string"],[1,"docs-api-property-default"],[1,"docs-api-property-description"],["pan","",1,"docs-api-property-type","PoCodeEditorRegisterableOptions"],["pan","",1,"docs-api-property-type","PoCodeEditorRegisterableSuggestionType"],[1,"docs-api-h4","docs-api-class-name"],["pan","",1,"docs-api-property-type","RegExp"],["pan","",1,"docs-api-property-type","boolean"],["pan","",1,"docs-api-property-type","Array<string>"],["pan","",1,"docs-api-property-type","PoCodeEditorRegisterableTokens"],["pan","",1,"docs-api-property-type","Array<any>"]],template:function(r,d){r&1&&(i(0,"div",0)(1,"p",1)(2,"code"),t(3,"import { PoCodeEditorModule } from '@po-ui/ng-code-editor';"),e()(),i(4,"div",2)(5,"p"),t(6,"M\xF3dulo do componente po-code-editor."),e()(),i(7,"h3",3),t(8,"Services"),e(),i(9,"h4",4)(10,"code",5),t(11,"PoCodeEditorRegister"),e()(),i(12,"div",2)(13,"p"),t(14,"Wrapper para registro de sintaxes customizadas para o po-code-editor."),e(),i(15,"p"),t(16,"Para utiliza\xE7\xE3o do servi\xE7o de idiomas "),i(17,"strong"),t(18,"PoCodeEditorRegister"),e(),t(19,`,
deve-se importar o m\xF3dulo PoCodeEditorModule mesmo j\xE1 tendo importado
o m\xF3dulo PoModule.
Na importa\xE7\xE3o opcionalmente pode ser invocado o m\xE9todo `),i(20,"strong"),t(21,"forRegister"),e(),t(22," informando um objeto para configura\xE7\xE3o."),e(),i(23,"p"),t(24,"Exemplo de configura\xE7\xE3o:"),e(),i(25,"pre")(26,"code"),t(27,`import { PoCodeEditorModule, PoCodeEditorRegisterable } from '@po-ui/ng-code-editor';
declare const monaco: any; // Importante para usar configura\xE7\xF5es com tipos definidos pelo Monaco
// A fun\xE7\xE3o \`provideCompletionItems\` precisa ser exportada para ser compat\xEDvel com AOT.
export function provideCompletionItems() {
const suggestions = [{
label: 'terraform',
insertText: '#terraform language'
}, {
label: 'server',
insertText: 'server \${1:ip}'
}];
return { suggestions: suggestions };
}
const customEditor: PoCodeEditorRegisterable = {
language: 'terraform',
options: {
keywords: ['resource', 'provider', 'variable', 'output', 'module', 'true', 'false'],
operators: ['{', '}', '(', ')', '[', ']', '?', ':'],
symbols: /[=><!~?:&|+\\-*\\/\\^%]+/,
escapes: /\\\\(?:[abfnrtv\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,
tokenizer: {
...
}
},
suggestions: { provideCompletionItems: provideCompletionItems }
};
@NgModule({
declarations: [],
imports: [
PoModule,
PoCodeEditorModule.forRegister(customEditor)
],
bootstrap: [AppComponent]
})`),e()(),i(28,"blockquote")(29,"p"),t(30,`As configura\xE7\xF5es para o registro de uma nova sintaxe no Monaco code editor podem ser encontradas em
`),i(31,"a",6)(32,"strong"),t(33,"Monaco Editor"),e()(),t(34,"."),e()()(),i(35,"h4",7),t(36,"Propriedades"),e(),i(37,"table",8)(38,"tr",9)(39,"th",10),t(40,"Nome"),e(),i(41,"th",10),t(42,"Tipo"),e(),i(43,"th",10),t(44,"Padr\xE3o"),e(),i(45,"th",10),t(46,"Descri\xE7\xE3o"),e()(),i(47,"tr",11)(48,"td",12)(49,"div",13)(50,"span",14),t(51,"p-language"),n(52,"br"),e()()(),i(53,"td",15)(54,"code",16),t(55,"string"),e()(),i(56,"td",17),t(57,"-"),e(),i(58,"td",18)(59,"p"),t(60,"Sintaxe a ser registrada."),e()()(),i(61,"tr",11)(62,"td",12)(63,"div",13)(64,"span",14),t(65,"p-options"),n(66,"br"),e()()(),i(67,"td",15)(68,"code",19),t(69,"PoCodeEditorRegisterableOptions"),e()(),i(70,"td",17),t(71,"-"),e(),i(72,"td",18)(73,"p"),t(74,"Op\xE7\xF5es da sintaxe para registro no po-code-editor."),e()()(),i(75,"tr",11)(76,"td",12)(77,"div",13)(78,"span",14),t(79,"p-suggestions"),n(80,"br"),e()()(),i(81,"td",15)(82,"code",20),t(83,"PoCodeEditorRegisterableSuggestionType"),e()(),i(84,"td",17),t(85,"-"),e(),i(86,"td",18)(87,"em")(88,"strong"),t(89,"(opcional)"),e()(),i(90,"p"),t(91,"Lista de sugest\xF5es para a fun\xE7\xE3o de autocomplete (CTRL + SPACE)."),e()()()(),i(92,"h3"),t(93,"Interfaces"),e(),i(94,"h4",21)(95,"code",5),t(96,"PoCodeEditorRegisterableOptions"),e()(),i(97,"div",2)(98,"p"),t(99,"Interface para configura\xE7\xE3o de Op\xE7\xF5es de novas sintaxes ao code editor."),e()(),i(100,"h4",7),t(101,"Propriedades"),e(),i(102,"table",8)(103,"tr",9)(104,"th",10),t(105,"Nome"),e(),i(106,"th",10),t(107,"Tipo"),e(),i(108,"th",10),t(109,"Descri\xE7\xE3o"),e()(),i(110,"tr",11)(111,"td",12)(112,"div",13)(113,"span",14),t(114," escapes"),n(115,"br"),e()()(),i(116,"td",15)(117,"code",22),t(118,"RegExp"),e()(),i(119,"td",18)(120,"p"),t(121,"Escapes espec\xEDficos da sintaxes."),e()()(),i(122,"tr",11)(123,"td",12)(124,"div",13)(125,"span",14),t(126," ignoreCase"),n(127,"br"),e()()(),i(128,"td",15)(129,"code",23),t(130,"boolean"),e()(),i(131,"td",18)(132,"em")(133,"strong"),t(134,"(opcional)"),e()(),i(135,"p"),t(136,"Define se a sintaxe ser\xE1 case sensitive ou n\xE3o."),e()()(),i(137,"tr",11)(138,"td",12)(139,"div",13)(140,"span",14),t(141," keywords"),n(142,"br"),e()()(),i(143,"td",15)(144,"code",24),t(145,"Array<string>"),e()(),i(146,"td",18)(147,"p"),t(148,"Palavras chaves da sintaxe."),e()()(),i(149,"tr",11)(150,"td",12)(151,"div",13)(152,"span",14),t(153," operators"),n(154,"br"),e()()(),i(155,"td",15)(156,"code",24),t(157,"Array<string>"),e()(),i(158,"td",18)(159,"p"),t(160,"Operadores espec\xEDficos da sintaxe."),e()()(),i(161,"tr",11)(162,"td",12)(163,"div",13)(164,"span",14),t(165," symbols"),n(166,"br"),e()()(),i(167,"td",15)(168,"code",22),t(169,"RegExp"),e()(),i(170,"td",18)(171,"p"),t(172,"S\xEDmbolos espec\xEDficos da sintaxes."),e()()(),i(173,"tr",11)(174,"td",12)(175,"div",13)(176,"span",14),t(177," tokenizer"),n(178,"br"),e()()(),i(179,"td",15)(180,"code",25),t(181,"PoCodeEditorRegisterableTokens"),e()(),i(182,"td",18)(183,"p"),t(184,"Interface para recebimento de token espec\xEDficos da sintaxe."),e()()()(),i(185,"h4",21)(186,"code",5),t(187,"PoCodeEditorRegisterableSuggestion"),e()(),i(188,"div",2)(189,"p"),t(190,"Interface para configura\xE7\xE3o da lista de sugest\xE3o do autocomplete do code editor."),e()(),i(191,"h4",7),t(192,"Propriedades"),e(),i(193,"table",8)(194,"tr",9)(195,"th",10),t(196,"Nome"),e(),i(197,"th",10),t(198,"Tipo"),e(),i(199,"th",10),t(200,"Descri\xE7\xE3o"),e()(),i(201,"tr",11)(202,"td",12)(203,"div",13)(204,"span",14),t(205," documentation"),n(206,"br"),e()()(),i(207,"td",15)(208,"code",16),t(209,"string"),e()(),i(210,"td",18)(211,"em")(212,"strong"),t(213,"(opcional)"),e()(),i(214,"p"),t(215,"Texto de ajuda que ser\xE1 exibido caso o usu\xE1rio deseje ver mais informa\xE7\xF5es sobre a sugest\xE3o."),e()()(),i(216,"tr",11)(217,"td",12)(218,"div",13)(219,"span",14),t(220," insertText"),n(221,"br"),e()()(),i(222,"td",15)(223,"code",16),t(224,"string"),e()(),i(225,"td",18)(226,"p"),t(227,"Texto que ser\xE1 inserido no editor ao selecionar a sugest\xE3o exibida pelo autocomplete."),e()()(),i(228,"tr",11)(229,"td",12)(230,"div",13)(231,"span",14),t(232," label"),n(233,"br"),e()()(),i(234,"td",15)(235,"code",16),t(236,"string"),e()(),i(237,"td",18)(238,"p"),t(239,"Texto que ser\xE1 exibido na lista de sugest\xF5es."),e()()()(),i(240,"h4",21)(241,"code",5),t(242,"PoCodeEditorRegisterableSuggestionType"),e()(),i(243,"div",2)(244,"p"),t(245,"Interface do objeto usado pelo monaco para lista de sugest\xE3o do autocomplete do code editor."),e()(),i(246,"h4",21)(247,"code",5),t(248,"PoCodeEditorRegisterableTokens"),e()(),i(249,"div",2)(250,"p"),t(251,"Interface para configura\xE7\xE3o de tokens de novas sintaxes ao code editor."),e()(),i(252,"h4",7),t(253,"Propriedades"),e(),i(254,"table",8)(255,"tr",9)(256,"th",10),t(257,"Nome"),e(),i(258,"th",10),t(259,"Tipo"),e(),i(260,"th",10),t(261,"Descri\xE7\xE3o"),e()(),i(262,"tr",11)(263,"td",12)(264,"div",13)(265,"span",14),t(266," comment"),n(267,"br"),e()()(),i(268,"td",15)(269,"code",26),t(270,"Array<any>"),e()(),i(271,"td",18)(272,"em")(273,"strong"),t(274,"(opcional)"),e()(),i(275,"p"),t(276,"Tokenizer de coment\xE1rios."),e()()(),i(277,"tr",11)(278,"td",12)(279,"div",13)(280,"span",14),t(281," interpolated"),n(282,"br"),e()()(),i(283,"td",15)(284,"code",26),t(285,"Array<any>"),e()(),i(286,"td",18)(287,"em")(288,"strong"),t(289,"(opcional)"),e()(),i(290,"p"),t(291,"Sequ\xEAncia de interpola\xE7\xE3o."),e()()(),i(292,"tr",11)(293,"td",12)(294,"div",13)(295,"span",14),t(296," interpolatedCompound"),n(297,"br"),e()()(),i(298,"td",15)(299,"code",26),t(300,"Array<any>"),e()(),i(301,"td",18)(302,"em")(303,"strong"),t(304,"(opcional)"),e()(),i(305,"p"),t(306,"Sequ\xEAncia de interpola\xE7\xE3o composta."),e()()(),i(307,"tr",11)(308,"td",12)(309,"div",13)(310,"span",14),t(311," root"),n(312,"br"),e()()(),i(313,"td",15)(314,"code",26),t(315,"Array<any>"),e()(),i(316,"td",18)(317,"p"),t(318,"Principal tokenizer da sintaxe customizada."),e()()(),i(319,"tr",11)(320,"td",12)(321,"div",13)(322,"span",14),t(323," string"),n(324,"br"),e()()(),i(325,"td",15)(326,"code",26),t(327,"Array<any>"),e()(),i(328,"td",18)(329,"em")(330,"strong"),t(331,"(opcional)"),e()(),i(332,"p"),t(333,"Tokenizer de strings."),e()()(),i(334,"tr",11)(335,"td",12)(336,"div",13)(337,"span",14),t(338," whitespace"),n(339,"br"),e()()(),i(340,"td",15)(341,"code",26),t(342,"Array<any>"),e()(),i(343,"td",18)(344,"em")(345,"strong"),t(346,"(opcional)"),e()(),i(347,"p"),t(348,"Tokenizer de whitespaces."),e()()()(),i(349,"h4",21)(350,"code",5),t(351,"PoCodeEditorRegisterable"),e()(),i(352,"div",2)(353,"p"),t(354,"Interface para configura\xE7\xE3o de novas sintaxes ao code editor."),e()(),i(355,"h4",7),t(356,"Propriedades"),e(),i(357,"table",8)(358,"tr",9)(359,"th",10),t(360,"Nome"),e(),i(361,"th",10),t(362,"Tipo"),e(),i(363,"th",10),t(364,"Descri\xE7\xE3o"),e()(),i(365,"tr",11)(366,"td",12)(367,"div",13)(368,"span",14),t(369," language"),n(370,"br"),e()()(),i(371,"td",15)(372,"code",16),t(373,"string"),e()(),i(374,"td",18)(375,"p"),t(376,"Nome da sintaxe a ser registrada no code editor."),e()()(),i(377,"tr",11)(378,"td",12)(379,"div",13)(380,"span",14),t(381," options"),n(382,"br"),e()()(),i(383,"td",15)(384,"code",19),t(385,"PoCodeEditorRegisterableOptions"),e()(),i(386,"td",18)(387,"p"),t(388,"Op\xE7\xF5es de configura\xE7\xE3o da sintaxe customizada."),e()()(),i(389,"tr",11)(390,"td",12)(391,"div",13)(392,"span",14),t(393," suggestions"),n(394,"br"),e()()(),i(395,"td",15)(396,"code",20),t(397,"PoCodeEditorRegisterableSuggestionType"),e()(),i(398,"td",18)(399,"em")(400,"strong"),t(401,"(opcional)"),e()(),i(402,"p"),t(403,"Lista de sugest\xF5es para a fun\xE7\xE3o de autocomplete."),e()()()()())},encapsulation:2})}return o})();var C=(()=>{class o{route;router;sub;hidePoWebSample=!0;samplesLength=0;activeTab="doc";actions=[{label:"Documenta\xE7\xE3o",action:this.goBack.bind(this),icon:"ph ph-file-text"},{label:"Colabore",action:this.improveDocs.bind(this)}];constructor(a,r){this.route=a,this.router=r}goBack(){this.router.navigate(["documentation"])}improveDocs(){this.router.navigate(["guides/development-flow"])}ngOnInit(){this.sub=this.route.queryParams.subscribe(a=>{let r=a.view;this.activeTab=r||"doc",this.hidePoWebSample=this.samplesLength===0})}ngOnDestroy(){this.sub.unsubscribe()}static \u0275fac=function(r){return new(r||o)(E(g),E(S))};static \u0275cmp=l({type:o,selectors:[["ng-component"]],standalone:!1,decls:5,vars:4,consts:[["p-title"," Code Editor Register",3,"p-actions"],["p-size","1"],["p-label","Documenta\xE7\xE3o",3,"p-active"],["p-label","Exemplos",3,"p-hide","p-active"]],template:function(r,d){r&1&&(i(0,"po-page-default",0)(1,"po-tabs",1)(2,"po-tab",2),n(3,"sample-po-code-editor-register-doc"),e(),n(4,"po-tab",3),e()()),r&2&&(p("p-actions",d.actions),c(2),p("p-active",d.activeTab.includes("doc")),c(2),p("p-hide",d.hidePoWebSample)("p-active",d.activeTab.includes("web")))},dependencies:[b,f,v,y],encapsulation:2})}return o})();var D=[{path:"",component:C}],P=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=s({type:o});static \u0275inj=m({imports:[u.forChild(D),u]})}return o})();var L=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=s({type:o});static \u0275inj=m({imports:[h,P]})}return o})();export{L as DocPoCodeEditorRegisterModule};